{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"http://hilpisch.com/tpq_logo.png\" alt=\"The Python Quants\" width=\"35%\" align=\"right\" border=\"0\"><br>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Python for Finance (2nd ed.)\n",
    "\n",
    "**Mastering Data-Driven Finance**\n",
    "\n",
    "&copy; Dr. Yves J. Hilpisch | The Python Quants GmbH\n",
    "\n",
    "<img src=\"http://hilpisch.com/images/py4fi_2nd_shadow.png\" width=\"300px\" align=\"left\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Data Analysis with pandas"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## pandas Basics"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### First Steps with DataFrame Class"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "uuid": "eda2a742-134d-4d47-8b30-557b846b9bb3"
   },
   "outputs": [],
   "source": [
    "import pandas as pd  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame([10, 20, 30, 40],  \n",
    "                  columns=['numbers'],  \n",
    "                  index=['a', 'b', 'c', 'd'])  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "uuid": "f3be2d89-829a-49b2-96fc-07c475db1e3f"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>numbers</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   numbers\n",
       "a       10\n",
       "b       20\n",
       "c       30\n",
       "d       40"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "uuid": "47b70a7b-710f-4c40-9a70-b09db7af1a12"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['a', 'b', 'c', 'd'], dtype='object')"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.index  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "uuid": "a36c6695-520d-4df1-a6fa-5f8362af37a3"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['numbers'], dtype='object')"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "uuid": "c93aed37-21de-429d-86ed-9849e4c3e23c"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numbers    30\n",
       "Name: c, dtype: int64"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc['c']  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "uuid": "8c7c2f69-3673-40d9-a568-0471c629810d"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>numbers</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   numbers\n",
       "a       10\n",
       "d       40"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[['a', 'd']]  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "uuid": "c3ce0cc3-26e8-4256-ab8c-9a2d4b181633"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>numbers</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>30</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   numbers\n",
       "b       20\n",
       "c       30"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[1:3]  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "uuid": "94b1d846-63df-49f4-8a7f-8fed03e5f4fa"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numbers    100\n",
       "dtype: int64"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sum()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "uuid": "4e73eb4f-352d-4527-b0c5-4f3a6e7eb354"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>numbers</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>400</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>1600</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   numbers\n",
       "a      100\n",
       "b      400\n",
       "c      900\n",
       "d     1600"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.apply(lambda x: x ** 2)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "uuid": "75206a83-0154-4be2-88d0-7a82a190fda1"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>numbers</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>400</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>1600</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   numbers\n",
       "a      100\n",
       "b      400\n",
       "c      900\n",
       "d     1600"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df ** 2  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['floats'] = (1.5, 2.5, 3.5, 4.5)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "uuid": "49a2633a-b3c0-4d00-a227-e0ff4a8cf81d"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>numbers</th>\n",
       "      <th>floats</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>10</td>\n",
       "      <td>1.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>20</td>\n",
       "      <td>2.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>30</td>\n",
       "      <td>3.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>40</td>\n",
       "      <td>4.5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   numbers  floats\n",
       "a       10     1.5\n",
       "b       20     2.5\n",
       "c       30     3.5\n",
       "d       40     4.5"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "uuid": "c49b9aea-417a-4c2b-8e27-0e8771a77c87"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "a    1.5\n",
       "b    2.5\n",
       "c    3.5\n",
       "d    4.5\n",
       "Name: floats, dtype: float64"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['floats']  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['names'] = pd.DataFrame(['Yves', 'Sandra', 'Lilli', 'Henry'],\n",
    "                           index=['d', 'a', 'b', 'c'])  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "uuid": "aa892c41-6637-45ed-876b-6a70285e4c0b"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>numbers</th>\n",
       "      <th>floats</th>\n",
       "      <th>names</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>10</td>\n",
       "      <td>1.5</td>\n",
       "      <td>Sandra</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>20</td>\n",
       "      <td>2.5</td>\n",
       "      <td>Lilli</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>30</td>\n",
       "      <td>3.5</td>\n",
       "      <td>Henry</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>40</td>\n",
       "      <td>4.5</td>\n",
       "      <td>Yves</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   numbers  floats   names\n",
       "a       10     1.5  Sandra\n",
       "b       20     2.5   Lilli\n",
       "c       30     3.5   Henry\n",
       "d       40     4.5    Yves"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "uuid": "584ac18c-161f-4c7b-8ff1-1cd406fb8437"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>numbers</th>\n",
       "      <th>floats</th>\n",
       "      <th>names</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>10</td>\n",
       "      <td>1.50</td>\n",
       "      <td>Sandra</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>20</td>\n",
       "      <td>2.50</td>\n",
       "      <td>Lilli</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>30</td>\n",
       "      <td>3.50</td>\n",
       "      <td>Henry</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>40</td>\n",
       "      <td>4.50</td>\n",
       "      <td>Yves</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>100</td>\n",
       "      <td>5.75</td>\n",
       "      <td>Jil</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   numbers  floats   names\n",
       "0       10    1.50  Sandra\n",
       "1       20    2.50   Lilli\n",
       "2       30    3.50   Henry\n",
       "3       40    4.50    Yves\n",
       "4      100    5.75     Jil"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.append({'numbers': 100, 'floats': 5.75, 'names': 'Jil'},\n",
    "               ignore_index=True)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df.append(pd.DataFrame({'numbers': 100, 'floats': 5.75,\n",
    "                             'names': 'Jil'}, index=['y',]))  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "uuid": "9068cd04-c6ff-4d0c-bd52-cf04cd89a0e9"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>numbers</th>\n",
       "      <th>floats</th>\n",
       "      <th>names</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>10</td>\n",
       "      <td>1.50</td>\n",
       "      <td>Sandra</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>20</td>\n",
       "      <td>2.50</td>\n",
       "      <td>Lilli</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>30</td>\n",
       "      <td>3.50</td>\n",
       "      <td>Henry</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>40</td>\n",
       "      <td>4.50</td>\n",
       "      <td>Yves</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>y</th>\n",
       "      <td>100</td>\n",
       "      <td>5.75</td>\n",
       "      <td>Jil</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   numbers  floats   names\n",
       "a       10    1.50  Sandra\n",
       "b       20    2.50   Lilli\n",
       "c       30    3.50   Henry\n",
       "d       40    4.50    Yves\n",
       "y      100    5.75     Jil"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df.append(pd.DataFrame({'names': 'Liz'}, index=['z',]), sort=False)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "uuid": "9068cd04-c6ff-4d0c-bd52-cf04cd89a0e9"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>numbers</th>\n",
       "      <th>floats</th>\n",
       "      <th>names</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>10.0</td>\n",
       "      <td>1.50</td>\n",
       "      <td>Sandra</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>20.0</td>\n",
       "      <td>2.50</td>\n",
       "      <td>Lilli</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>30.0</td>\n",
       "      <td>3.50</td>\n",
       "      <td>Henry</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>40.0</td>\n",
       "      <td>4.50</td>\n",
       "      <td>Yves</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>y</th>\n",
       "      <td>100.0</td>\n",
       "      <td>5.75</td>\n",
       "      <td>Jil</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>z</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>Liz</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   numbers  floats   names\n",
       "a     10.0    1.50  Sandra\n",
       "b     20.0    2.50   Lilli\n",
       "c     30.0    3.50   Henry\n",
       "d     40.0    4.50    Yves\n",
       "y    100.0    5.75     Jil\n",
       "z      NaN     NaN     Liz"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numbers    float64\n",
       "floats     float64\n",
       "names       object\n",
       "dtype: object"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.dtypes  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "uuid": "3e863c7f-7875-4911-997b-6e48123dc1e5"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numbers    40.00\n",
       "floats      3.55\n",
       "dtype: float64"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[['numbers', 'floats']].mean()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "uuid": "c52173a0-485d-4eb2-b6b4-407d1ff2c30e"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numbers    35.355339\n",
       "floats      1.662077\n",
       "dtype: float64"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[['numbers', 'floats']].std()  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Second Steps with DataFrame Class"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "np.random.seed(100)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "a = np.random.standard_normal((9, 4))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {
    "uuid": "d6f56a00-91e6-4221-a1ec-6093f416d1be"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-1.74976547,  0.3426804 ,  1.1530358 , -0.25243604],\n",
       "       [ 0.98132079,  0.51421884,  0.22117967, -1.07004333],\n",
       "       [-0.18949583,  0.25500144, -0.45802699,  0.43516349],\n",
       "       [-0.58359505,  0.81684707,  0.67272081, -0.10441114],\n",
       "       [-0.53128038,  1.02973269, -0.43813562, -1.11831825],\n",
       "       [ 1.61898166,  1.54160517, -0.25187914, -0.84243574],\n",
       "       [ 0.18451869,  0.9370822 ,  0.73100034,  1.36155613],\n",
       "       [-0.32623806,  0.05567601,  0.22239961, -1.443217  ],\n",
       "       [-0.75635231,  0.81645401,  0.75044476, -0.45594693]])"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame(a)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "uuid": "450bd14d-7668-4f3f-a863-966f13562818"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-1.749765</td>\n",
       "      <td>0.342680</td>\n",
       "      <td>1.153036</td>\n",
       "      <td>-0.252436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.981321</td>\n",
       "      <td>0.514219</td>\n",
       "      <td>0.221180</td>\n",
       "      <td>-1.070043</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.189496</td>\n",
       "      <td>0.255001</td>\n",
       "      <td>-0.458027</td>\n",
       "      <td>0.435163</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.583595</td>\n",
       "      <td>0.816847</td>\n",
       "      <td>0.672721</td>\n",
       "      <td>-0.104411</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.531280</td>\n",
       "      <td>1.029733</td>\n",
       "      <td>-0.438136</td>\n",
       "      <td>-1.118318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1.618982</td>\n",
       "      <td>1.541605</td>\n",
       "      <td>-0.251879</td>\n",
       "      <td>-0.842436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.184519</td>\n",
       "      <td>0.937082</td>\n",
       "      <td>0.731000</td>\n",
       "      <td>1.361556</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-0.326238</td>\n",
       "      <td>0.055676</td>\n",
       "      <td>0.222400</td>\n",
       "      <td>-1.443217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>-0.756352</td>\n",
       "      <td>0.816454</td>\n",
       "      <td>0.750445</td>\n",
       "      <td>-0.455947</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          0         1         2         3\n",
       "0 -1.749765  0.342680  1.153036 -0.252436\n",
       "1  0.981321  0.514219  0.221180 -1.070043\n",
       "2 -0.189496  0.255001 -0.458027  0.435163\n",
       "3 -0.583595  0.816847  0.672721 -0.104411\n",
       "4 -0.531280  1.029733 -0.438136 -1.118318\n",
       "5  1.618982  1.541605 -0.251879 -0.842436\n",
       "6  0.184519  0.937082  0.731000  1.361556\n",
       "7 -0.326238  0.055676  0.222400 -1.443217\n",
       "8 -0.756352  0.816454  0.750445 -0.455947"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.columns = ['No1', 'No2', 'No3', 'No4']  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "uuid": "968395a4-12bc-46d2-b486-6c767abce366"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>No1</th>\n",
       "      <th>No2</th>\n",
       "      <th>No3</th>\n",
       "      <th>No4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-1.749765</td>\n",
       "      <td>0.342680</td>\n",
       "      <td>1.153036</td>\n",
       "      <td>-0.252436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.981321</td>\n",
       "      <td>0.514219</td>\n",
       "      <td>0.221180</td>\n",
       "      <td>-1.070043</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.189496</td>\n",
       "      <td>0.255001</td>\n",
       "      <td>-0.458027</td>\n",
       "      <td>0.435163</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.583595</td>\n",
       "      <td>0.816847</td>\n",
       "      <td>0.672721</td>\n",
       "      <td>-0.104411</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-0.531280</td>\n",
       "      <td>1.029733</td>\n",
       "      <td>-0.438136</td>\n",
       "      <td>-1.118318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1.618982</td>\n",
       "      <td>1.541605</td>\n",
       "      <td>-0.251879</td>\n",
       "      <td>-0.842436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.184519</td>\n",
       "      <td>0.937082</td>\n",
       "      <td>0.731000</td>\n",
       "      <td>1.361556</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-0.326238</td>\n",
       "      <td>0.055676</td>\n",
       "      <td>0.222400</td>\n",
       "      <td>-1.443217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>-0.756352</td>\n",
       "      <td>0.816454</td>\n",
       "      <td>0.750445</td>\n",
       "      <td>-0.455947</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        No1       No2       No3       No4\n",
       "0 -1.749765  0.342680  1.153036 -0.252436\n",
       "1  0.981321  0.514219  0.221180 -1.070043\n",
       "2 -0.189496  0.255001 -0.458027  0.435163\n",
       "3 -0.583595  0.816847  0.672721 -0.104411\n",
       "4 -0.531280  1.029733 -0.438136 -1.118318\n",
       "5  1.618982  1.541605 -0.251879 -0.842436\n",
       "6  0.184519  0.937082  0.731000  1.361556\n",
       "7 -0.326238  0.055676  0.222400 -1.443217\n",
       "8 -0.756352  0.816454  0.750445 -0.455947"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "uuid": "68e8d73f-93d3-47ac-a656-1edbdebcd1ff"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.7010330941456459"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['No2'].mean()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "dates = pd.date_range('2019-1-1', periods=9, freq='M')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {
    "uuid": "a80e1e88-d211-4ee4-a6d3-90403a7739a8"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2019-01-31', '2019-02-28', '2019-03-31', '2019-04-30',\n",
       "               '2019-05-31', '2019-06-30', '2019-07-31', '2019-08-31',\n",
       "               '2019-09-30'],\n",
       "              dtype='datetime64[ns]', freq='M')"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dates"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.index = dates"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "uuid": "d8fef9ed-25ca-4ae0-bd0c-026d340a903b"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>No1</th>\n",
       "      <th>No2</th>\n",
       "      <th>No3</th>\n",
       "      <th>No4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-31</th>\n",
       "      <td>-1.749765</td>\n",
       "      <td>0.342680</td>\n",
       "      <td>1.153036</td>\n",
       "      <td>-0.252436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-28</th>\n",
       "      <td>0.981321</td>\n",
       "      <td>0.514219</td>\n",
       "      <td>0.221180</td>\n",
       "      <td>-1.070043</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-03-31</th>\n",
       "      <td>-0.189496</td>\n",
       "      <td>0.255001</td>\n",
       "      <td>-0.458027</td>\n",
       "      <td>0.435163</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-04-30</th>\n",
       "      <td>-0.583595</td>\n",
       "      <td>0.816847</td>\n",
       "      <td>0.672721</td>\n",
       "      <td>-0.104411</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-31</th>\n",
       "      <td>-0.531280</td>\n",
       "      <td>1.029733</td>\n",
       "      <td>-0.438136</td>\n",
       "      <td>-1.118318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-06-30</th>\n",
       "      <td>1.618982</td>\n",
       "      <td>1.541605</td>\n",
       "      <td>-0.251879</td>\n",
       "      <td>-0.842436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-07-31</th>\n",
       "      <td>0.184519</td>\n",
       "      <td>0.937082</td>\n",
       "      <td>0.731000</td>\n",
       "      <td>1.361556</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-08-31</th>\n",
       "      <td>-0.326238</td>\n",
       "      <td>0.055676</td>\n",
       "      <td>0.222400</td>\n",
       "      <td>-1.443217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-09-30</th>\n",
       "      <td>-0.756352</td>\n",
       "      <td>0.816454</td>\n",
       "      <td>0.750445</td>\n",
       "      <td>-0.455947</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 No1       No2       No3       No4\n",
       "2019-01-31 -1.749765  0.342680  1.153036 -0.252436\n",
       "2019-02-28  0.981321  0.514219  0.221180 -1.070043\n",
       "2019-03-31 -0.189496  0.255001 -0.458027  0.435163\n",
       "2019-04-30 -0.583595  0.816847  0.672721 -0.104411\n",
       "2019-05-31 -0.531280  1.029733 -0.438136 -1.118318\n",
       "2019-06-30  1.618982  1.541605 -0.251879 -0.842436\n",
       "2019-07-31  0.184519  0.937082  0.731000  1.361556\n",
       "2019-08-31 -0.326238  0.055676  0.222400 -1.443217\n",
       "2019-09-30 -0.756352  0.816454  0.750445 -0.455947"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "uuid": "bcc38d60-3e1c-49bb-b883-ea7564c136b4"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-1.74976547,  0.3426804 ,  1.1530358 , -0.25243604],\n",
       "       [ 0.98132079,  0.51421884,  0.22117967, -1.07004333],\n",
       "       [-0.18949583,  0.25500144, -0.45802699,  0.43516349],\n",
       "       [-0.58359505,  0.81684707,  0.67272081, -0.10441114],\n",
       "       [-0.53128038,  1.02973269, -0.43813562, -1.11831825],\n",
       "       [ 1.61898166,  1.54160517, -0.25187914, -0.84243574],\n",
       "       [ 0.18451869,  0.9370822 ,  0.73100034,  1.36155613],\n",
       "       [-0.32623806,  0.05567601,  0.22239961, -1.443217  ],\n",
       "       [-0.75635231,  0.81645401,  0.75044476, -0.45594693]])"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "uuid": "bcc38d60-3e1c-49bb-b883-ea7564c136b4"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-1.74976547,  0.3426804 ,  1.1530358 , -0.25243604],\n",
       "       [ 0.98132079,  0.51421884,  0.22117967, -1.07004333],\n",
       "       [-0.18949583,  0.25500144, -0.45802699,  0.43516349],\n",
       "       [-0.58359505,  0.81684707,  0.67272081, -0.10441114],\n",
       "       [-0.53128038,  1.02973269, -0.43813562, -1.11831825],\n",
       "       [ 1.61898166,  1.54160517, -0.25187914, -0.84243574],\n",
       "       [ 0.18451869,  0.9370822 ,  0.73100034,  1.36155613],\n",
       "       [-0.32623806,  0.05567601,  0.22239961, -1.443217  ],\n",
       "       [-0.75635231,  0.81645401,  0.75044476, -0.45594693]])"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.array(df)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Basic Analytics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "DatetimeIndex: 9 entries, 2019-01-31 to 2019-09-30\n",
      "Freq: M\n",
      "Data columns (total 4 columns):\n",
      " #   Column  Non-Null Count  Dtype  \n",
      "---  ------  --------------  -----  \n",
      " 0   No1     9 non-null      float64\n",
      " 1   No2     9 non-null      float64\n",
      " 2   No3     9 non-null      float64\n",
      " 3   No4     9 non-null      float64\n",
      "dtypes: float64(4)\n",
      "memory usage: 360.0 bytes\n"
     ]
    }
   ],
   "source": [
    "df.info()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "uuid": "125980cc-91ec-4ab4-9a4a-cfd772dd1254"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>No1</th>\n",
       "      <th>No2</th>\n",
       "      <th>No3</th>\n",
       "      <th>No4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>9.000000</td>\n",
       "      <td>9.000000</td>\n",
       "      <td>9.000000</td>\n",
       "      <td>9.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>-0.150212</td>\n",
       "      <td>0.701033</td>\n",
       "      <td>0.289193</td>\n",
       "      <td>-0.387788</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>0.988306</td>\n",
       "      <td>0.457685</td>\n",
       "      <td>0.579920</td>\n",
       "      <td>0.877532</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>-1.749765</td>\n",
       "      <td>0.055676</td>\n",
       "      <td>-0.458027</td>\n",
       "      <td>-1.443217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>-0.583595</td>\n",
       "      <td>0.342680</td>\n",
       "      <td>-0.251879</td>\n",
       "      <td>-1.070043</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>-0.326238</td>\n",
       "      <td>0.816454</td>\n",
       "      <td>0.222400</td>\n",
       "      <td>-0.455947</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>0.184519</td>\n",
       "      <td>0.937082</td>\n",
       "      <td>0.731000</td>\n",
       "      <td>-0.104411</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>1.618982</td>\n",
       "      <td>1.541605</td>\n",
       "      <td>1.153036</td>\n",
       "      <td>1.361556</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            No1       No2       No3       No4\n",
       "count  9.000000  9.000000  9.000000  9.000000\n",
       "mean  -0.150212  0.701033  0.289193 -0.387788\n",
       "std    0.988306  0.457685  0.579920  0.877532\n",
       "min   -1.749765  0.055676 -0.458027 -1.443217\n",
       "25%   -0.583595  0.342680 -0.251879 -1.070043\n",
       "50%   -0.326238  0.816454  0.222400 -0.455947\n",
       "75%    0.184519  0.937082  0.731000 -0.104411\n",
       "max    1.618982  1.541605  1.153036  1.361556"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "uuid": "f760ea25-c64c-4e70-9f91-b72701d919ce"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "No1   -1.351906\n",
       "No2    6.309298\n",
       "No3    2.602739\n",
       "No4   -3.490089\n",
       "dtype: float64"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sum()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {
    "uuid": "3dd9bd77-eb80-46cb-87f3-62c053a8e223"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "No1   -0.150212\n",
       "No2    0.701033\n",
       "No3    0.289193\n",
       "No4   -0.387788\n",
       "dtype: float64"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.mean()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "uuid": "3dd9bd77-eb80-46cb-87f3-62c053a8e223"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "No1   -0.150212\n",
       "No2    0.701033\n",
       "No3    0.289193\n",
       "No4   -0.387788\n",
       "dtype: float64"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.mean(axis=0)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2019-01-31   -0.126621\n",
       "2019-02-28    0.161669\n",
       "2019-03-31    0.010661\n",
       "2019-04-30    0.200390\n",
       "2019-05-31   -0.264500\n",
       "2019-06-30    0.516568\n",
       "2019-07-31    0.803539\n",
       "2019-08-31   -0.372845\n",
       "2019-09-30    0.088650\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.mean(axis=1)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {
    "uuid": "8e167ea8-09b7-4585-8cac-28fe20eefe66"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>No1</th>\n",
       "      <th>No2</th>\n",
       "      <th>No3</th>\n",
       "      <th>No4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-31</th>\n",
       "      <td>-1.749765</td>\n",
       "      <td>0.342680</td>\n",
       "      <td>1.153036</td>\n",
       "      <td>-0.252436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-28</th>\n",
       "      <td>-0.768445</td>\n",
       "      <td>0.856899</td>\n",
       "      <td>1.374215</td>\n",
       "      <td>-1.322479</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-03-31</th>\n",
       "      <td>-0.957941</td>\n",
       "      <td>1.111901</td>\n",
       "      <td>0.916188</td>\n",
       "      <td>-0.887316</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-04-30</th>\n",
       "      <td>-1.541536</td>\n",
       "      <td>1.928748</td>\n",
       "      <td>1.588909</td>\n",
       "      <td>-0.991727</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-31</th>\n",
       "      <td>-2.072816</td>\n",
       "      <td>2.958480</td>\n",
       "      <td>1.150774</td>\n",
       "      <td>-2.110045</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-06-30</th>\n",
       "      <td>-0.453834</td>\n",
       "      <td>4.500086</td>\n",
       "      <td>0.898895</td>\n",
       "      <td>-2.952481</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-07-31</th>\n",
       "      <td>-0.269316</td>\n",
       "      <td>5.437168</td>\n",
       "      <td>1.629895</td>\n",
       "      <td>-1.590925</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-08-31</th>\n",
       "      <td>-0.595554</td>\n",
       "      <td>5.492844</td>\n",
       "      <td>1.852294</td>\n",
       "      <td>-3.034142</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-09-30</th>\n",
       "      <td>-1.351906</td>\n",
       "      <td>6.309298</td>\n",
       "      <td>2.602739</td>\n",
       "      <td>-3.490089</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 No1       No2       No3       No4\n",
       "2019-01-31 -1.749765  0.342680  1.153036 -0.252436\n",
       "2019-02-28 -0.768445  0.856899  1.374215 -1.322479\n",
       "2019-03-31 -0.957941  1.111901  0.916188 -0.887316\n",
       "2019-04-30 -1.541536  1.928748  1.588909 -0.991727\n",
       "2019-05-31 -2.072816  2.958480  1.150774 -2.110045\n",
       "2019-06-30 -0.453834  4.500086  0.898895 -2.952481\n",
       "2019-07-31 -0.269316  5.437168  1.629895 -1.590925\n",
       "2019-08-31 -0.595554  5.492844  1.852294 -3.034142\n",
       "2019-09-30 -1.351906  6.309298  2.602739 -3.490089"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.cumsum()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "No1   -0.150212\n",
       "No2    0.701033\n",
       "No3    0.289193\n",
       "No4   -0.387788\n",
       "dtype: float64"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.mean(df)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>No1</th>\n",
       "      <th>No2</th>\n",
       "      <th>No3</th>\n",
       "      <th>No4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-31</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.070957</td>\n",
       "      <td>0.142398</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-28</th>\n",
       "      <td>-0.018856</td>\n",
       "      <td>-0.665106</td>\n",
       "      <td>-1.508780</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-03-31</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.366486</td>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.832033</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-04-30</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.202303</td>\n",
       "      <td>-0.396425</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-31</th>\n",
       "      <td>NaN</td>\n",
       "      <td>0.029299</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-06-30</th>\n",
       "      <td>0.481797</td>\n",
       "      <td>0.432824</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-07-31</th>\n",
       "      <td>-1.690005</td>\n",
       "      <td>-0.064984</td>\n",
       "      <td>-0.313341</td>\n",
       "      <td>0.308628</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-08-31</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-2.888206</td>\n",
       "      <td>-1.503279</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-09-30</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-0.202785</td>\n",
       "      <td>-0.287089</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 No1       No2       No3       No4\n",
       "2019-01-31       NaN -1.070957  0.142398       NaN\n",
       "2019-02-28 -0.018856 -0.665106 -1.508780       NaN\n",
       "2019-03-31       NaN -1.366486       NaN -0.832033\n",
       "2019-04-30       NaN -0.202303 -0.396425       NaN\n",
       "2019-05-31       NaN  0.029299       NaN       NaN\n",
       "2019-06-30  0.481797  0.432824       NaN       NaN\n",
       "2019-07-31 -1.690005 -0.064984 -0.313341  0.308628\n",
       "2019-08-31       NaN -2.888206 -1.503279       NaN\n",
       "2019-09-30       NaN -0.202785 -0.287089       NaN"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# raises warning\n",
    "np.log(df)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {
    "uuid": "9dfc1e40-c030-4a9c-9e3a-ff28c64a93df"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>No1</th>\n",
       "      <th>No2</th>\n",
       "      <th>No3</th>\n",
       "      <th>No4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-31</th>\n",
       "      <td>1.322787</td>\n",
       "      <td>0.585389</td>\n",
       "      <td>1.073795</td>\n",
       "      <td>0.502430</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-28</th>\n",
       "      <td>0.990616</td>\n",
       "      <td>0.717091</td>\n",
       "      <td>0.470297</td>\n",
       "      <td>1.034429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-03-31</th>\n",
       "      <td>0.435311</td>\n",
       "      <td>0.504977</td>\n",
       "      <td>0.676777</td>\n",
       "      <td>0.659669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-04-30</th>\n",
       "      <td>0.763934</td>\n",
       "      <td>0.903796</td>\n",
       "      <td>0.820196</td>\n",
       "      <td>0.323127</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-31</th>\n",
       "      <td>0.728890</td>\n",
       "      <td>1.014757</td>\n",
       "      <td>0.661918</td>\n",
       "      <td>1.057506</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-06-30</th>\n",
       "      <td>1.272392</td>\n",
       "      <td>1.241614</td>\n",
       "      <td>0.501876</td>\n",
       "      <td>0.917843</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-07-31</th>\n",
       "      <td>0.429556</td>\n",
       "      <td>0.968030</td>\n",
       "      <td>0.854986</td>\n",
       "      <td>1.166857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-08-31</th>\n",
       "      <td>0.571173</td>\n",
       "      <td>0.235958</td>\n",
       "      <td>0.471593</td>\n",
       "      <td>1.201340</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-09-30</th>\n",
       "      <td>0.869685</td>\n",
       "      <td>0.903578</td>\n",
       "      <td>0.866282</td>\n",
       "      <td>0.675238</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 No1       No2       No3       No4\n",
       "2019-01-31  1.322787  0.585389  1.073795  0.502430\n",
       "2019-02-28  0.990616  0.717091  0.470297  1.034429\n",
       "2019-03-31  0.435311  0.504977  0.676777  0.659669\n",
       "2019-04-30  0.763934  0.903796  0.820196  0.323127\n",
       "2019-05-31  0.728890  1.014757  0.661918  1.057506\n",
       "2019-06-30  1.272392  1.241614  0.501876  0.917843\n",
       "2019-07-31  0.429556  0.968030  0.854986  1.166857\n",
       "2019-08-31  0.571173  0.235958  0.471593  1.201340\n",
       "2019-09-30  0.869685  0.903578  0.866282  0.675238"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sqrt(abs(df))  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {
    "uuid": "a540362b-50d7-4ef0-89ba-0b6ee38033f6"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "No1    7.384345\n",
       "No2    7.075190\n",
       "No3    6.397719\n",
       "No4    7.538440\n",
       "dtype: float64"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.sqrt(abs(df)).sum()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>No1</th>\n",
       "      <th>No2</th>\n",
       "      <th>No3</th>\n",
       "      <th>No4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-31</th>\n",
       "      <td>-74.976547</td>\n",
       "      <td>134.268040</td>\n",
       "      <td>215.303580</td>\n",
       "      <td>74.756396</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-28</th>\n",
       "      <td>198.132079</td>\n",
       "      <td>151.421884</td>\n",
       "      <td>122.117967</td>\n",
       "      <td>-7.004333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-03-31</th>\n",
       "      <td>81.050417</td>\n",
       "      <td>125.500144</td>\n",
       "      <td>54.197301</td>\n",
       "      <td>143.516349</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-04-30</th>\n",
       "      <td>41.640495</td>\n",
       "      <td>181.684707</td>\n",
       "      <td>167.272081</td>\n",
       "      <td>89.558886</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-31</th>\n",
       "      <td>46.871962</td>\n",
       "      <td>202.973269</td>\n",
       "      <td>56.186438</td>\n",
       "      <td>-11.831825</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-06-30</th>\n",
       "      <td>261.898166</td>\n",
       "      <td>254.160517</td>\n",
       "      <td>74.812086</td>\n",
       "      <td>15.756426</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-07-31</th>\n",
       "      <td>118.451869</td>\n",
       "      <td>193.708220</td>\n",
       "      <td>173.100034</td>\n",
       "      <td>236.155613</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-08-31</th>\n",
       "      <td>67.376194</td>\n",
       "      <td>105.567601</td>\n",
       "      <td>122.239961</td>\n",
       "      <td>-44.321700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-09-30</th>\n",
       "      <td>24.364769</td>\n",
       "      <td>181.645401</td>\n",
       "      <td>175.044476</td>\n",
       "      <td>54.405307</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   No1         No2         No3         No4\n",
       "2019-01-31  -74.976547  134.268040  215.303580   74.756396\n",
       "2019-02-28  198.132079  151.421884  122.117967   -7.004333\n",
       "2019-03-31   81.050417  125.500144   54.197301  143.516349\n",
       "2019-04-30   41.640495  181.684707  167.272081   89.558886\n",
       "2019-05-31   46.871962  202.973269   56.186438  -11.831825\n",
       "2019-06-30  261.898166  254.160517   74.812086   15.756426\n",
       "2019-07-31  118.451869  193.708220  173.100034  236.155613\n",
       "2019-08-31   67.376194  105.567601  122.239961  -44.321700\n",
       "2019-09-30   24.364769  181.645401  175.044476   54.405307"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "100 * df + 100  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Basic Visualization"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pylab import plt, mpl  \n",
    "plt.style.use('seaborn')  \n",
    "mpl.rcParams['font.family'] = 'serif'  \n",
    "%config InlineBackend.figure_format = 'svg'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {
    "uuid": "4b1834ec-9f9b-41d6-8d06-f2efc8433dc4"
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"368.435938pt\" version=\"1.1\" viewBox=\"0 0 603.727344 368.435938\" width=\"603.727344pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-08-08T13:05:45.623216</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.1, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 368.435938 \n",
       "L 603.727344 368.435938 \n",
       "L 603.727344 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 28.942188 333.36 \n",
       "L 586.942188 333.36 \n",
       "L 586.942188 7.2 \n",
       "L 28.942188 7.2 \n",
       "z\n",
       "\" style=\"fill:#eaeaf2;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#p8ea5f2232f)\" d=\"M 28.942187 333.36 \n",
       "L 28.942187 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\"/>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- Jan -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(20.735937 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M -538 -1119 \n",
       "L -538 -384 \n",
       "L -181 -384 \n",
       "Q -172 -694 -34 -845 \n",
       "Q 103 -997 378 -997 \n",
       "Q 750 -997 897 -762 \n",
       "Q 1044 -528 1044 153 \n",
       "L 1044 4331 \n",
       "L 319 4331 \n",
       "L 319 4666 \n",
       "L 2272 4666 \n",
       "L 2272 4331 \n",
       "L 1678 4331 \n",
       "L 1678 128 \n",
       "Q 1678 -644 1368 -987 \n",
       "Q 1059 -1331 372 -1331 \n",
       "Q 150 -1331 -79 -1278 \n",
       "Q -309 -1225 -538 -1119 \n",
       "z\n",
       "\" id=\"DejaVuSerif-4a\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 2547 1044 \n",
       "L 2547 1747 \n",
       "L 1806 1747 \n",
       "Q 1378 1747 1168 1562 \n",
       "Q 959 1378 959 997 \n",
       "Q 959 650 1171 447 \n",
       "Q 1384 244 1747 244 \n",
       "Q 2106 244 2326 466 \n",
       "Q 2547 688 2547 1044 \n",
       "z\n",
       "M 3122 2075 \n",
       "L 3122 331 \n",
       "L 3634 331 \n",
       "L 3634 0 \n",
       "L 2547 0 \n",
       "L 2547 359 \n",
       "Q 2356 128 2106 18 \n",
       "Q 1856 -91 1522 -91 \n",
       "Q 969 -91 644 203 \n",
       "Q 319 497 319 997 \n",
       "Q 319 1513 691 1797 \n",
       "Q 1063 2081 1741 2081 \n",
       "L 2547 2081 \n",
       "L 2547 2309 \n",
       "Q 2547 2688 2317 2895 \n",
       "Q 2088 3103 1672 3103 \n",
       "Q 1328 3103 1125 2947 \n",
       "Q 922 2791 872 2484 \n",
       "L 575 2484 \n",
       "L 575 3156 \n",
       "Q 875 3284 1158 3348 \n",
       "Q 1441 3413 1709 3413 \n",
       "Q 2400 3413 2761 3070 \n",
       "Q 3122 2728 3122 2075 \n",
       "z\n",
       "\" id=\"DejaVuSerif-61\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 263 0 \n",
       "L 263 331 \n",
       "L 781 331 \n",
       "L 781 2988 \n",
       "L 231 2988 \n",
       "L 231 3322 \n",
       "L 1356 3322 \n",
       "L 1356 2731 \n",
       "Q 1516 3069 1770 3241 \n",
       "Q 2025 3413 2363 3413 \n",
       "Q 2913 3413 3172 3097 \n",
       "Q 3431 2781 3431 2113 \n",
       "L 3431 331 \n",
       "L 3944 331 \n",
       "L 3944 0 \n",
       "L 2356 0 \n",
       "L 2356 331 \n",
       "L 2853 331 \n",
       "L 2853 1931 \n",
       "Q 2853 2541 2703 2767 \n",
       "Q 2553 2994 2175 2994 \n",
       "Q 1775 2994 1565 2701 \n",
       "Q 1356 2409 1356 1850 \n",
       "L 1356 331 \n",
       "L 1856 331 \n",
       "L 1856 0 \n",
       "L 263 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6e\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4a\"/>\n",
       "       <use x=\"40.087891\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "       <use x=\"99.707031\" xlink:href=\"#DejaVuSerif-6e\"/>\n",
       "      </g>\n",
       "      <!-- 2019 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(16.217187 359.15625)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 819 3553 \n",
       "L 469 3553 \n",
       "L 469 4384 \n",
       "Q 803 4563 1142 4656 \n",
       "Q 1481 4750 1806 4750 \n",
       "Q 2534 4750 2956 4397 \n",
       "Q 3378 4044 3378 3438 \n",
       "Q 3378 2753 2422 1800 \n",
       "Q 2347 1728 2309 1691 \n",
       "L 1131 513 \n",
       "L 3078 513 \n",
       "L 3078 1088 \n",
       "L 3444 1088 \n",
       "L 3444 0 \n",
       "L 434 0 \n",
       "L 434 341 \n",
       "L 1850 1753 \n",
       "Q 2319 2222 2519 2614 \n",
       "Q 2719 3006 2719 3438 \n",
       "Q 2719 3909 2473 4175 \n",
       "Q 2228 4441 1797 4441 \n",
       "Q 1350 4441 1106 4219 \n",
       "Q 863 3997 819 3553 \n",
       "z\n",
       "\" id=\"DejaVuSerif-32\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 2034 219 \n",
       "Q 2513 219 2750 744 \n",
       "Q 2988 1269 2988 2328 \n",
       "Q 2988 3391 2750 3916 \n",
       "Q 2513 4441 2034 4441 \n",
       "Q 1556 4441 1318 3916 \n",
       "Q 1081 3391 1081 2328 \n",
       "Q 1081 1269 1318 744 \n",
       "Q 1556 219 2034 219 \n",
       "z\n",
       "M 2034 -91 \n",
       "Q 1275 -91 848 546 \n",
       "Q 422 1184 422 2328 \n",
       "Q 422 3475 848 4112 \n",
       "Q 1275 4750 2034 4750 \n",
       "Q 2797 4750 3222 4112 \n",
       "Q 3647 3475 3647 2328 \n",
       "Q 3647 1184 3222 546 \n",
       "Q 2797 -91 2034 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-30\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 909 0 \n",
       "L 909 331 \n",
       "L 1722 331 \n",
       "L 1722 4213 \n",
       "L 781 3603 \n",
       "L 781 4013 \n",
       "L 1919 4750 \n",
       "L 2350 4750 \n",
       "L 2350 331 \n",
       "L 3163 331 \n",
       "L 3163 0 \n",
       "L 909 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-31\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 2994 2091 \n",
       "Q 2784 1856 2512 1740 \n",
       "Q 2241 1625 1900 1625 \n",
       "Q 1206 1625 804 2044 \n",
       "Q 403 2463 403 3188 \n",
       "Q 403 3897 839 4323 \n",
       "Q 1275 4750 2003 4750 \n",
       "Q 2794 4750 3217 4161 \n",
       "Q 3641 3572 3641 2478 \n",
       "Q 3641 1253 3137 581 \n",
       "Q 2634 -91 1722 -91 \n",
       "Q 1475 -91 1203 -44 \n",
       "Q 931 3 647 97 \n",
       "L 647 872 \n",
       "L 997 872 \n",
       "Q 1038 556 1241 387 \n",
       "Q 1444 219 1784 219 \n",
       "Q 2391 219 2687 676 \n",
       "Q 2984 1134 2994 2091 \n",
       "z\n",
       "M 1978 4441 \n",
       "Q 1534 4441 1298 4117 \n",
       "Q 1063 3794 1063 3188 \n",
       "Q 1063 2581 1298 2256 \n",
       "Q 1534 1931 1978 1931 \n",
       "Q 2422 1931 2658 2245 \n",
       "Q 2894 2559 2894 3150 \n",
       "Q 2894 3772 2656 4106 \n",
       "Q 2419 4441 1978 4441 \n",
       "z\n",
       "\" id=\"DejaVuSerif-39\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\"/>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- Feb -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(89.3375 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 353 0 \n",
       "L 353 331 \n",
       "L 947 331 \n",
       "L 947 4331 \n",
       "L 353 4331 \n",
       "L 353 4666 \n",
       "L 4172 4666 \n",
       "L 4172 3628 \n",
       "L 3788 3628 \n",
       "L 3788 4281 \n",
       "L 1581 4281 \n",
       "L 1581 2719 \n",
       "L 3175 2719 \n",
       "L 3175 3303 \n",
       "L 3559 3303 \n",
       "L 3559 1753 \n",
       "L 3175 1753 \n",
       "L 3175 2338 \n",
       "L 1581 2338 \n",
       "L 1581 331 \n",
       "L 2328 331 \n",
       "L 2328 0 \n",
       "L 353 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-46\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 3469 1600 \n",
       "L 991 1600 \n",
       "L 991 1575 \n",
       "Q 991 903 1244 561 \n",
       "Q 1497 219 1991 219 \n",
       "Q 2369 219 2611 417 \n",
       "Q 2853 616 2950 1006 \n",
       "L 3413 1006 \n",
       "Q 3275 459 2904 184 \n",
       "Q 2534 -91 1931 -91 \n",
       "Q 1203 -91 761 389 \n",
       "Q 319 869 319 1663 \n",
       "Q 319 2450 753 2931 \n",
       "Q 1188 3413 1894 3413 \n",
       "Q 2647 3413 3050 2948 \n",
       "Q 3453 2484 3469 1600 \n",
       "z\n",
       "M 2791 1931 \n",
       "Q 2772 2513 2545 2808 \n",
       "Q 2319 3103 1894 3103 \n",
       "Q 1497 3103 1269 2806 \n",
       "Q 1041 2509 991 1931 \n",
       "L 2791 1931 \n",
       "z\n",
       "\" id=\"DejaVuSerif-65\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 738 331 \n",
       "L 738 4531 \n",
       "L 184 4531 \n",
       "L 184 4863 \n",
       "L 1313 4863 \n",
       "L 1313 2803 \n",
       "Q 1481 3116 1742 3264 \n",
       "Q 2003 3413 2388 3413 \n",
       "Q 3000 3413 3387 2928 \n",
       "Q 3775 2444 3775 1663 \n",
       "Q 3775 881 3387 395 \n",
       "Q 3000 -91 2388 -91 \n",
       "Q 2003 -91 1742 57 \n",
       "Q 1481 206 1313 519 \n",
       "L 1313 0 \n",
       "L 184 0 \n",
       "L 184 331 \n",
       "L 738 331 \n",
       "z\n",
       "M 1313 1497 \n",
       "Q 1313 897 1542 583 \n",
       "Q 1772 269 2209 269 \n",
       "Q 2650 269 2876 622 \n",
       "Q 3103 975 3103 1663 \n",
       "Q 3103 2353 2876 2703 \n",
       "Q 2650 3053 2209 3053 \n",
       "Q 1772 3053 1542 2737 \n",
       "Q 1313 2422 1313 1825 \n",
       "L 1313 1497 \n",
       "z\n",
       "\" id=\"DejaVuSerif-62\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-46\"/>\n",
       "       <use x=\"63.884766\" xlink:href=\"#DejaVuSerif-65\"/>\n",
       "       <use x=\"123.064453\" xlink:href=\"#DejaVuSerif-62\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_4\"/>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- Mar -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(157.951562 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 353 0 \n",
       "L 353 331 \n",
       "L 947 331 \n",
       "L 947 4331 \n",
       "L 319 4331 \n",
       "L 319 4666 \n",
       "L 1678 4666 \n",
       "L 3316 1344 \n",
       "L 4953 4666 \n",
       "L 6228 4666 \n",
       "L 6228 4331 \n",
       "L 5606 4331 \n",
       "L 5606 331 \n",
       "L 6203 331 \n",
       "L 6203 0 \n",
       "L 4378 0 \n",
       "L 4378 331 \n",
       "L 4972 331 \n",
       "L 4972 3938 \n",
       "L 3372 684 \n",
       "L 2931 684 \n",
       "L 1331 3938 \n",
       "L 1331 331 \n",
       "L 1925 331 \n",
       "L 1925 0 \n",
       "L 353 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-4d\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 3059 3328 \n",
       "L 3059 2497 \n",
       "L 2728 2497 \n",
       "Q 2713 2744 2591 2866 \n",
       "Q 2469 2988 2234 2988 \n",
       "Q 1809 2988 1582 2694 \n",
       "Q 1356 2400 1356 1850 \n",
       "L 1356 331 \n",
       "L 2022 331 \n",
       "L 2022 0 \n",
       "L 263 0 \n",
       "L 263 331 \n",
       "L 781 331 \n",
       "L 781 2994 \n",
       "L 231 2994 \n",
       "L 231 3322 \n",
       "L 1356 3322 \n",
       "L 1356 2731 \n",
       "Q 1525 3078 1790 3245 \n",
       "Q 2056 3413 2438 3413 \n",
       "Q 2578 3413 2733 3391 \n",
       "Q 2888 3369 3059 3328 \n",
       "z\n",
       "\" id=\"DejaVuSerif-72\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4d\"/>\n",
       "       <use x=\"102.392578\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "       <use x=\"162.011719\" xlink:href=\"#DejaVuSerif-72\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_5\"/>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- Apr -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(228.990625 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1281 1691 \n",
       "L 2994 1691 \n",
       "L 2138 3909 \n",
       "L 1281 1691 \n",
       "z\n",
       "M -38 0 \n",
       "L -38 331 \n",
       "L 372 331 \n",
       "L 2034 4666 \n",
       "L 2559 4666 \n",
       "L 4225 331 \n",
       "L 4684 331 \n",
       "L 4684 0 \n",
       "L 2988 0 \n",
       "L 2988 331 \n",
       "L 3506 331 \n",
       "L 3116 1356 \n",
       "L 1153 1356 \n",
       "L 763 331 \n",
       "L 1275 331 \n",
       "L 1275 0 \n",
       "L -38 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-41\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 1313 1825 \n",
       "L 1313 1497 \n",
       "Q 1313 897 1542 583 \n",
       "Q 1772 269 2209 269 \n",
       "Q 2650 269 2876 622 \n",
       "Q 3103 975 3103 1663 \n",
       "Q 3103 2353 2876 2703 \n",
       "Q 2650 3053 2209 3053 \n",
       "Q 1772 3053 1542 2737 \n",
       "Q 1313 2422 1313 1825 \n",
       "z\n",
       "M 738 2988 \n",
       "L 184 2988 \n",
       "L 184 3322 \n",
       "L 1313 3322 \n",
       "L 1313 2803 \n",
       "Q 1481 3116 1742 3264 \n",
       "Q 2003 3413 2388 3413 \n",
       "Q 3000 3413 3387 2928 \n",
       "Q 3775 2444 3775 1663 \n",
       "Q 3775 881 3387 395 \n",
       "Q 3000 -91 2388 -91 \n",
       "Q 2003 -91 1742 57 \n",
       "Q 1481 206 1313 519 \n",
       "L 1313 -997 \n",
       "L 1856 -997 \n",
       "L 1856 -1331 \n",
       "L 184 -1331 \n",
       "L 184 -997 \n",
       "L 738 -997 \n",
       "L 738 2988 \n",
       "z\n",
       "\" id=\"DejaVuSerif-70\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-41\"/>\n",
       "       <use x=\"72.216797\" xlink:href=\"#DejaVuSerif-70\"/>\n",
       "       <use x=\"136.230469\" xlink:href=\"#DejaVuSerif-72\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_6\"/>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- May -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(297.016406 344.21625)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1381 -609 \n",
       "L 1600 -56 \n",
       "L 359 2988 \n",
       "L -19 2988 \n",
       "L -19 3322 \n",
       "L 1509 3322 \n",
       "L 1509 2988 \n",
       "L 978 2988 \n",
       "L 1913 703 \n",
       "L 2847 2988 \n",
       "L 2350 2988 \n",
       "L 2350 3322 \n",
       "L 3597 3322 \n",
       "L 3597 2988 \n",
       "L 3225 2988 \n",
       "L 1703 -750 \n",
       "Q 1547 -1138 1356 -1280 \n",
       "Q 1166 -1422 819 -1422 \n",
       "Q 672 -1422 517 -1397 \n",
       "Q 363 -1372 206 -1325 \n",
       "L 206 -691 \n",
       "L 500 -691 \n",
       "Q 519 -903 608 -995 \n",
       "Q 697 -1088 884 -1088 \n",
       "Q 1056 -1088 1161 -992 \n",
       "Q 1266 -897 1381 -609 \n",
       "z\n",
       "\" id=\"DejaVuSerif-79\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4d\"/>\n",
       "       <use x=\"102.392578\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "       <use x=\"162.011719\" xlink:href=\"#DejaVuSerif-79\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_7\"/>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- Jun -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(369.246875 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2266 3322 \n",
       "L 3341 3322 \n",
       "L 3341 331 \n",
       "L 3884 331 \n",
       "L 3884 0 \n",
       "L 2766 0 \n",
       "L 2766 588 \n",
       "Q 2606 256 2353 82 \n",
       "Q 2100 -91 1766 -91 \n",
       "Q 1213 -91 952 223 \n",
       "Q 691 538 691 1209 \n",
       "L 691 2988 \n",
       "L 172 2988 \n",
       "L 172 3322 \n",
       "L 1269 3322 \n",
       "L 1269 1388 \n",
       "Q 1269 781 1417 556 \n",
       "Q 1566 331 1947 331 \n",
       "Q 2347 331 2556 625 \n",
       "Q 2766 919 2766 1478 \n",
       "L 2766 2988 \n",
       "L 2266 2988 \n",
       "L 2266 3322 \n",
       "z\n",
       "\" id=\"DejaVuSerif-75\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4a\"/>\n",
       "       <use x=\"40.087891\" xlink:href=\"#DejaVuSerif-75\"/>\n",
       "       <use x=\"104.492188\" xlink:href=\"#DejaVuSerif-6e\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_8\"/>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- Jul -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(440.617969 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1313 331 \n",
       "L 1856 331 \n",
       "L 1856 0 \n",
       "L 184 0 \n",
       "L 184 331 \n",
       "L 738 331 \n",
       "L 738 4531 \n",
       "L 184 4531 \n",
       "L 184 4863 \n",
       "L 1313 4863 \n",
       "L 1313 331 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6c\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4a\"/>\n",
       "       <use x=\"40.087891\" xlink:href=\"#DejaVuSerif-75\"/>\n",
       "       <use x=\"104.492188\" xlink:href=\"#DejaVuSerif-6c\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_8\">\n",
       "     <g id=\"line2d_9\"/>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- Aug -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(507.160156 344.21625)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3359 2988 \n",
       "L 3359 72 \n",
       "Q 3359 -644 2965 -1033 \n",
       "Q 2572 -1422 1844 -1422 \n",
       "Q 1516 -1422 1216 -1362 \n",
       "Q 916 -1303 641 -1184 \n",
       "L 641 -488 \n",
       "L 941 -488 \n",
       "Q 997 -813 1206 -963 \n",
       "Q 1416 -1113 1806 -1113 \n",
       "Q 2313 -1113 2548 -827 \n",
       "Q 2784 -541 2784 72 \n",
       "L 2784 519 \n",
       "Q 2616 206 2355 57 \n",
       "Q 2094 -91 1709 -91 \n",
       "Q 1097 -91 708 395 \n",
       "Q 319 881 319 1663 \n",
       "Q 319 2444 706 2928 \n",
       "Q 1094 3413 1709 3413 \n",
       "Q 2094 3413 2355 3264 \n",
       "Q 2616 3116 2784 2803 \n",
       "L 2784 3322 \n",
       "L 3909 3322 \n",
       "L 3909 2988 \n",
       "L 3359 2988 \n",
       "z\n",
       "M 2784 1825 \n",
       "Q 2784 2422 2554 2737 \n",
       "Q 2325 3053 1888 3053 \n",
       "Q 1444 3053 1217 2703 \n",
       "Q 991 2353 991 1663 \n",
       "Q 991 975 1217 622 \n",
       "Q 1444 269 1888 269 \n",
       "Q 2325 269 2554 583 \n",
       "Q 2784 897 2784 1497 \n",
       "L 2784 1825 \n",
       "z\n",
       "\" id=\"DejaVuSerif-67\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-41\"/>\n",
       "       <use x=\"72.216797\" xlink:href=\"#DejaVuSerif-75\"/>\n",
       "       <use x=\"136.621094\" xlink:href=\"#DejaVuSerif-67\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_9\">\n",
       "     <g id=\"line2d_10\"/>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- Sep -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(577.357031 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 594 225 \n",
       "L 594 1288 \n",
       "L 953 1284 \n",
       "Q 969 753 1261 498 \n",
       "Q 1553 244 2150 244 \n",
       "Q 2706 244 2998 464 \n",
       "Q 3291 684 3291 1106 \n",
       "Q 3291 1444 3114 1625 \n",
       "Q 2938 1806 2369 1978 \n",
       "L 1753 2163 \n",
       "Q 1084 2366 811 2669 \n",
       "Q 538 2972 538 3500 \n",
       "Q 538 4094 959 4422 \n",
       "Q 1381 4750 2144 4750 \n",
       "Q 2469 4750 2856 4679 \n",
       "Q 3244 4609 3681 4475 \n",
       "L 3681 3481 \n",
       "L 3328 3481 \n",
       "Q 3275 3975 2998 4195 \n",
       "Q 2722 4416 2156 4416 \n",
       "Q 1663 4416 1405 4214 \n",
       "Q 1147 4013 1147 3628 \n",
       "Q 1147 3294 1340 3103 \n",
       "Q 1534 2913 2163 2725 \n",
       "L 2741 2553 \n",
       "Q 3375 2363 3645 2067 \n",
       "Q 3916 1772 3916 1275 \n",
       "Q 3916 597 3481 253 \n",
       "Q 3047 -91 2188 -91 \n",
       "Q 1803 -91 1404 -12 \n",
       "Q 1006 66 594 225 \n",
       "z\n",
       "\" id=\"DejaVuSerif-53\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-53\"/>\n",
       "       <use x=\"68.505859\" xlink:href=\"#DejaVuSerif-65\"/>\n",
       "       <use x=\"127.685547\" xlink:href=\"#DejaVuSerif-70\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path clip-path=\"url(#p8ea5f2232f)\" d=\"M 28.942188 273.447553 \n",
       "L 586.942188 273.447553 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\"/>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- −2 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 277.246771)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 678 2259 \n",
       "L 4684 2259 \n",
       "L 4684 1753 \n",
       "L 678 1753 \n",
       "L 678 2259 \n",
       "z\n",
       "\" id=\"DejaVuSerif-2212\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-2212\"/>\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSerif-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path clip-path=\"url(#p8ea5f2232f)\" d=\"M 28.942188 212.931706 \n",
       "L 586.942188 212.931706 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\"/>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 216.730924)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path clip-path=\"url(#p8ea5f2232f)\" d=\"M 28.942188 152.415859 \n",
       "L 586.942188 152.415859 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\"/>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 2 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 156.215078)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path clip-path=\"url(#p8ea5f2232f)\" d=\"M 28.942188 91.900012 \n",
       "L 586.942188 91.900012 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\"/>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 4 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 95.699231)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2234 1581 \n",
       "L 2234 4063 \n",
       "L 641 1581 \n",
       "L 2234 1581 \n",
       "z\n",
       "M 3609 0 \n",
       "L 1484 0 \n",
       "L 1484 331 \n",
       "L 2234 331 \n",
       "L 2234 1247 \n",
       "L 197 1247 \n",
       "L 197 1588 \n",
       "L 2241 4750 \n",
       "L 2859 4750 \n",
       "L 2859 1581 \n",
       "L 3750 1581 \n",
       "L 3750 1247 \n",
       "L 2859 1247 \n",
       "L 2859 331 \n",
       "L 3609 331 \n",
       "L 3609 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <path clip-path=\"url(#p8ea5f2232f)\" d=\"M 28.942188 31.384165 \n",
       "L 586.942188 31.384165 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_20\"/>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 6 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 35.183384)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2094 219 \n",
       "Q 2534 219 2771 542 \n",
       "Q 3009 866 3009 1472 \n",
       "Q 3009 2078 2771 2401 \n",
       "Q 2534 2725 2094 2725 \n",
       "Q 1647 2725 1412 2412 \n",
       "Q 1178 2100 1178 1509 \n",
       "Q 1178 888 1415 553 \n",
       "Q 1653 219 2094 219 \n",
       "z\n",
       "M 1075 2569 \n",
       "Q 1288 2803 1556 2918 \n",
       "Q 1825 3034 2163 3034 \n",
       "Q 2859 3034 3264 2615 \n",
       "Q 3669 2197 3669 1472 \n",
       "Q 3669 763 3233 336 \n",
       "Q 2797 -91 2069 -91 \n",
       "Q 1278 -91 853 498 \n",
       "Q 428 1088 428 2181 \n",
       "Q 428 3406 931 4078 \n",
       "Q 1434 4750 2350 4750 \n",
       "Q 2597 4750 2869 4703 \n",
       "Q 3141 4656 3425 4563 \n",
       "L 3425 3794 \n",
       "L 3072 3794 \n",
       "Q 3034 4109 2831 4275 \n",
       "Q 2628 4441 2284 4441 \n",
       "Q 1678 4441 1381 3981 \n",
       "Q 1084 3522 1075 2569 \n",
       "z\n",
       "\" id=\"DejaVuSerif-36\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-36\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_21\">\n",
       "    <path clip-path=\"url(#p8ea5f2232f)\" d=\"M 28.942187 265.875975 \n",
       "L 98.692187 236.183246 \n",
       "L 168.442187 241.916996 \n",
       "L 238.192187 259.575371 \n",
       "L 307.942187 275.650812 \n",
       "L 377.692187 226.663789 \n",
       "L 447.442187 221.080636 \n",
       "L 517.192187 230.951922 \n",
       "L 586.942187 253.837573 \n",
       "\" style=\"fill:none;stroke:#4c72b0;stroke-linecap:round;stroke-width:2;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_22\">\n",
       "    <path clip-path=\"url(#p8ea5f2232f)\" d=\"M 28.942187 202.562908 \n",
       "L 98.692187 187.003714 \n",
       "L 168.442187 179.2879 \n",
       "L 238.192187 154.571804 \n",
       "L 307.942187 123.414231 \n",
       "L 377.692187 76.76846 \n",
       "L 447.442187 48.414298 \n",
       "L 517.192187 46.729657 \n",
       "L 586.942187 22.025455 \n",
       "\" style=\"fill:none;stroke:#55a868;stroke-linecap:round;stroke-width:2;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_23\">\n",
       "    <path clip-path=\"url(#p8ea5f2232f)\" d=\"M 28.942187 178.043237 \n",
       "L 98.692187 171.350799 \n",
       "L 168.442187 185.209745 \n",
       "L 238.192187 164.85461 \n",
       "L 307.942187 178.111684 \n",
       "L 377.692187 185.733024 \n",
       "L 447.442187 163.614471 \n",
       "L 517.192187 156.885121 \n",
       "L 586.942187 134.178221 \n",
       "\" style=\"fill:none;stroke:#c44e52;stroke-linecap:round;stroke-width:2;\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_24\">\n",
       "    <path clip-path=\"url(#p8ea5f2232f)\" d=\"M 28.942187 220.569896 \n",
       "L 98.692187 252.947185 \n",
       "L 168.442187 239.780042 \n",
       "L 238.192187 242.939306 \n",
       "L 307.942187 276.777294 \n",
       "L 377.692187 302.26765 \n",
       "L 447.442187 261.069789 \n",
       "L 517.192187 304.738538 \n",
       "L 586.942187 318.534545 \n",
       "\" style=\"fill:none;stroke:#8172b2;stroke-linecap:round;stroke-width:2;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 28.942188 333.36 \n",
       "L 28.942188 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 586.942188 333.36 \n",
       "L 586.942188 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 28.942187 333.36 \n",
       "L 586.942187 333.36 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 28.942187 7.2 \n",
       "L 586.942187 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"line2d_25\">\n",
       "     <path d=\"M 37.942188 20.298438 \n",
       "L 57.942188 20.298438 \n",
       "\" style=\"fill:none;stroke:#4c72b0;stroke-linecap:round;stroke-width:2;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_26\"/>\n",
       "    <g id=\"text_15\">\n",
       "     <!-- No1 -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(65.942188 23.798438)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 313 0 \n",
       "L 313 331 \n",
       "L 941 331 \n",
       "L 941 4331 \n",
       "L 313 4331 \n",
       "L 313 4666 \n",
       "L 1509 4666 \n",
       "L 4306 984 \n",
       "L 4306 4331 \n",
       "L 3681 4331 \n",
       "L 3681 4666 \n",
       "L 5319 4666 \n",
       "L 5319 4331 \n",
       "L 4691 4331 \n",
       "L 4691 -91 \n",
       "L 4313 -91 \n",
       "L 1325 3841 \n",
       "L 1325 331 \n",
       "L 1953 331 \n",
       "L 1953 0 \n",
       "L 313 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-4e\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1925 219 \n",
       "Q 2388 219 2623 584 \n",
       "Q 2859 950 2859 1663 \n",
       "Q 2859 2375 2623 2739 \n",
       "Q 2388 3103 1925 3103 \n",
       "Q 1463 3103 1227 2739 \n",
       "Q 991 2375 991 1663 \n",
       "Q 991 950 1228 584 \n",
       "Q 1466 219 1925 219 \n",
       "z\n",
       "M 1925 -91 \n",
       "Q 1200 -91 759 389 \n",
       "Q 319 869 319 1663 \n",
       "Q 319 2456 758 2934 \n",
       "Q 1197 3413 1925 3413 \n",
       "Q 2653 3413 3092 2934 \n",
       "Q 3531 2456 3531 1663 \n",
       "Q 3531 869 3092 389 \n",
       "Q 2653 -91 1925 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6f\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSerif-4e\"/>\n",
       "      <use x=\"87.5\" xlink:href=\"#DejaVuSerif-6f\"/>\n",
       "      <use x=\"147.705078\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_27\">\n",
       "     <path d=\"M 37.942188 34.976563 \n",
       "L 57.942188 34.976563 \n",
       "\" style=\"fill:none;stroke:#55a868;stroke-linecap:round;stroke-width:2;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_28\"/>\n",
       "    <g id=\"text_16\">\n",
       "     <!-- No2 -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(65.942188 38.476563)scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSerif-4e\"/>\n",
       "      <use x=\"87.5\" xlink:href=\"#DejaVuSerif-6f\"/>\n",
       "      <use x=\"147.705078\" xlink:href=\"#DejaVuSerif-32\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_29\">\n",
       "     <path d=\"M 37.942188 49.654688 \n",
       "L 57.942188 49.654688 \n",
       "\" style=\"fill:none;stroke:#c44e52;stroke-linecap:round;stroke-width:2;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_30\"/>\n",
       "    <g id=\"text_17\">\n",
       "     <!-- No3 -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(65.942188 53.154688)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 622 4469 \n",
       "Q 988 4606 1323 4678 \n",
       "Q 1659 4750 1953 4750 \n",
       "Q 2638 4750 3022 4454 \n",
       "Q 3406 4159 3406 3634 \n",
       "Q 3406 3213 3140 2930 \n",
       "Q 2875 2647 2388 2547 \n",
       "Q 2963 2466 3280 2130 \n",
       "Q 3597 1794 3597 1259 \n",
       "Q 3597 606 3158 257 \n",
       "Q 2719 -91 1894 -91 \n",
       "Q 1528 -91 1179 -12 \n",
       "Q 831 66 488 225 \n",
       "L 488 1131 \n",
       "L 838 1131 \n",
       "Q 869 681 1141 450 \n",
       "Q 1413 219 1906 219 \n",
       "Q 2384 219 2661 495 \n",
       "Q 2938 772 2938 1253 \n",
       "Q 2938 1803 2653 2086 \n",
       "Q 2369 2369 1819 2369 \n",
       "L 1522 2369 \n",
       "L 1522 2688 \n",
       "L 1678 2688 \n",
       "Q 2225 2688 2498 2914 \n",
       "Q 2772 3141 2772 3597 \n",
       "Q 2772 4006 2547 4223 \n",
       "Q 2322 4441 1900 4441 \n",
       "Q 1478 4441 1245 4241 \n",
       "Q 1013 4041 972 3647 \n",
       "L 622 3647 \n",
       "L 622 4469 \n",
       "z\n",
       "\" id=\"DejaVuSerif-33\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSerif-4e\"/>\n",
       "      <use x=\"87.5\" xlink:href=\"#DejaVuSerif-6f\"/>\n",
       "      <use x=\"147.705078\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_31\">\n",
       "     <path d=\"M 37.942188 64.332813 \n",
       "L 57.942188 64.332813 \n",
       "\" style=\"fill:none;stroke:#8172b2;stroke-linecap:round;stroke-width:2;\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_32\"/>\n",
       "    <g id=\"text_18\">\n",
       "     <!-- No4 -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(65.942188 67.832813)scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSerif-4e\"/>\n",
       "      <use x=\"87.5\" xlink:href=\"#DejaVuSerif-6f\"/>\n",
       "      <use x=\"147.705078\" xlink:href=\"#DejaVuSerif-34\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p8ea5f2232f\">\n",
       "   <rect height=\"326.16\" width=\"558\" x=\"28.942188\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df.cumsum().plot(lw=2.0, figsize=(10, 6));  \n",
    "# plt.savefig('../../images/ch05/pd_plot_01.png')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {
    "uuid": "4b1834ec-9f9b-41d6-8d06-f2efc8433dc4"
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"408.816502pt\" version=\"1.1\" viewBox=\"0 0 620.893437 408.816502\" width=\"620.893437pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-08-08T13:05:45.698005</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.1, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 408.816502 \n",
       "L 620.893437 408.816502 \n",
       "L 620.893437 -0 \n",
       "L 0 -0 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 38.482813 333.36 \n",
       "L 596.482813 333.36 \n",
       "L 596.482813 7.2 \n",
       "L 38.482813 7.2 \n",
       "z\n",
       "\" style=\"fill:#eaeaf2;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 69.482813 333.36 \n",
       "L 69.482813 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\"/>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 2019-01-31 00:00:00 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(25.071407 399.81544)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 819 3553 \n",
       "L 469 3553 \n",
       "L 469 4384 \n",
       "Q 803 4563 1142 4656 \n",
       "Q 1481 4750 1806 4750 \n",
       "Q 2534 4750 2956 4397 \n",
       "Q 3378 4044 3378 3438 \n",
       "Q 3378 2753 2422 1800 \n",
       "Q 2347 1728 2309 1691 \n",
       "L 1131 513 \n",
       "L 3078 513 \n",
       "L 3078 1088 \n",
       "L 3444 1088 \n",
       "L 3444 0 \n",
       "L 434 0 \n",
       "L 434 341 \n",
       "L 1850 1753 \n",
       "Q 2319 2222 2519 2614 \n",
       "Q 2719 3006 2719 3438 \n",
       "Q 2719 3909 2473 4175 \n",
       "Q 2228 4441 1797 4441 \n",
       "Q 1350 4441 1106 4219 \n",
       "Q 863 3997 819 3553 \n",
       "z\n",
       "\" id=\"DejaVuSerif-32\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 2034 219 \n",
       "Q 2513 219 2750 744 \n",
       "Q 2988 1269 2988 2328 \n",
       "Q 2988 3391 2750 3916 \n",
       "Q 2513 4441 2034 4441 \n",
       "Q 1556 4441 1318 3916 \n",
       "Q 1081 3391 1081 2328 \n",
       "Q 1081 1269 1318 744 \n",
       "Q 1556 219 2034 219 \n",
       "z\n",
       "M 2034 -91 \n",
       "Q 1275 -91 848 546 \n",
       "Q 422 1184 422 2328 \n",
       "Q 422 3475 848 4112 \n",
       "Q 1275 4750 2034 4750 \n",
       "Q 2797 4750 3222 4112 \n",
       "Q 3647 3475 3647 2328 \n",
       "Q 3647 1184 3222 546 \n",
       "Q 2797 -91 2034 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-30\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 909 0 \n",
       "L 909 331 \n",
       "L 1722 331 \n",
       "L 1722 4213 \n",
       "L 781 3603 \n",
       "L 781 4013 \n",
       "L 1919 4750 \n",
       "L 2350 4750 \n",
       "L 2350 331 \n",
       "L 3163 331 \n",
       "L 3163 0 \n",
       "L 909 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-31\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 2994 2091 \n",
       "Q 2784 1856 2512 1740 \n",
       "Q 2241 1625 1900 1625 \n",
       "Q 1206 1625 804 2044 \n",
       "Q 403 2463 403 3188 \n",
       "Q 403 3897 839 4323 \n",
       "Q 1275 4750 2003 4750 \n",
       "Q 2794 4750 3217 4161 \n",
       "Q 3641 3572 3641 2478 \n",
       "Q 3641 1253 3137 581 \n",
       "Q 2634 -91 1722 -91 \n",
       "Q 1475 -91 1203 -44 \n",
       "Q 931 3 647 97 \n",
       "L 647 872 \n",
       "L 997 872 \n",
       "Q 1038 556 1241 387 \n",
       "Q 1444 219 1784 219 \n",
       "Q 2391 219 2687 676 \n",
       "Q 2984 1134 2994 2091 \n",
       "z\n",
       "M 1978 4441 \n",
       "Q 1534 4441 1298 4117 \n",
       "Q 1063 3794 1063 3188 \n",
       "Q 1063 2581 1298 2256 \n",
       "Q 1534 1931 1978 1931 \n",
       "Q 2422 1931 2658 2245 \n",
       "Q 2894 2559 2894 3150 \n",
       "Q 2894 3772 2656 4106 \n",
       "Q 2419 4441 1978 4441 \n",
       "z\n",
       "\" id=\"DejaVuSerif-39\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 281 1959 \n",
       "L 1881 1959 \n",
       "L 1881 1472 \n",
       "L 281 1472 \n",
       "L 281 1959 \n",
       "z\n",
       "\" id=\"DejaVuSerif-2d\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 622 4469 \n",
       "Q 988 4606 1323 4678 \n",
       "Q 1659 4750 1953 4750 \n",
       "Q 2638 4750 3022 4454 \n",
       "Q 3406 4159 3406 3634 \n",
       "Q 3406 3213 3140 2930 \n",
       "Q 2875 2647 2388 2547 \n",
       "Q 2963 2466 3280 2130 \n",
       "Q 3597 1794 3597 1259 \n",
       "Q 3597 606 3158 257 \n",
       "Q 2719 -91 1894 -91 \n",
       "Q 1528 -91 1179 -12 \n",
       "Q 831 66 488 225 \n",
       "L 488 1131 \n",
       "L 838 1131 \n",
       "Q 869 681 1141 450 \n",
       "Q 1413 219 1906 219 \n",
       "Q 2384 219 2661 495 \n",
       "Q 2938 772 2938 1253 \n",
       "Q 2938 1803 2653 2086 \n",
       "Q 2369 2369 1819 2369 \n",
       "L 1522 2369 \n",
       "L 1522 2688 \n",
       "L 1678 2688 \n",
       "Q 2225 2688 2498 2914 \n",
       "Q 2772 3141 2772 3597 \n",
       "Q 2772 4006 2547 4223 \n",
       "Q 2322 4441 1900 4441 \n",
       "Q 1478 4441 1245 4241 \n",
       "Q 1013 4041 972 3647 \n",
       "L 622 3647 \n",
       "L 622 4469 \n",
       "z\n",
       "\" id=\"DejaVuSerif-33\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSerif-20\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 666 325 \n",
       "Q 666 500 786 622 \n",
       "Q 906 744 1081 744 \n",
       "Q 1256 744 1376 622 \n",
       "Q 1497 500 1497 325 \n",
       "Q 1497 150 1378 29 \n",
       "Q 1259 -91 1081 -91 \n",
       "Q 903 -91 784 29 \n",
       "Q 666 150 666 325 \n",
       "z\n",
       "M 666 2363 \n",
       "Q 666 2538 786 2658 \n",
       "Q 906 2778 1081 2778 \n",
       "Q 1259 2778 1378 2659 \n",
       "Q 1497 2541 1497 2363 \n",
       "Q 1497 2184 1378 2065 \n",
       "Q 1259 1947 1081 1947 \n",
       "Q 906 1947 786 2067 \n",
       "Q 666 2188 666 2363 \n",
       "z\n",
       "\" id=\"DejaVuSerif-3a\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"351.904297\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"415.527344\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"449.316406\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"512.939453\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"576.5625\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"608.349609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"671.972656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"735.595703\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"769.287109\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"832.910156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"896.533203\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"930.224609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"993.847656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 131.482813 333.36 \n",
       "L 131.482813 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_4\"/>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 2019-02-28 00:00:00 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(87.071407 399.81544)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2981 1275 \n",
       "Q 2981 1775 2732 2051 \n",
       "Q 2484 2328 2034 2328 \n",
       "Q 1584 2328 1336 2051 \n",
       "Q 1088 1775 1088 1275 \n",
       "Q 1088 772 1336 495 \n",
       "Q 1584 219 2034 219 \n",
       "Q 2484 219 2732 495 \n",
       "Q 2981 772 2981 1275 \n",
       "z\n",
       "M 2853 3541 \n",
       "Q 2853 3966 2637 4203 \n",
       "Q 2422 4441 2034 4441 \n",
       "Q 1650 4441 1433 4203 \n",
       "Q 1216 3966 1216 3541 \n",
       "Q 1216 3113 1433 2875 \n",
       "Q 1650 2638 2034 2638 \n",
       "Q 2422 2638 2637 2875 \n",
       "Q 2853 3113 2853 3541 \n",
       "z\n",
       "M 2516 2484 \n",
       "Q 3047 2413 3344 2092 \n",
       "Q 3641 1772 3641 1275 \n",
       "Q 3641 619 3225 264 \n",
       "Q 2809 -91 2034 -91 \n",
       "Q 1263 -91 845 264 \n",
       "Q 428 619 428 1275 \n",
       "Q 428 1772 725 2092 \n",
       "Q 1022 2413 1556 2484 \n",
       "Q 1084 2569 832 2842 \n",
       "Q 581 3116 581 3541 \n",
       "Q 581 4103 968 4426 \n",
       "Q 1356 4750 2034 4750 \n",
       "Q 2713 4750 3100 4426 \n",
       "Q 3488 4103 3488 3541 \n",
       "Q 3488 3116 3236 2842 \n",
       "Q 2984 2569 2516 2484 \n",
       "z\n",
       "\" id=\"DejaVuSerif-38\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"351.904297\" xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"415.527344\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"449.316406\" xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"512.939453\" xlink:href=\"#DejaVuSerif-38\"/>\n",
       "       <use x=\"576.5625\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"608.349609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"671.972656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"735.595703\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"769.287109\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"832.910156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"896.533203\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"930.224609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"993.847656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 193.482813 333.36 \n",
       "L 193.482813 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_6\"/>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2019-03-31 00:00:00 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(149.071407 399.81544)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"351.904297\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"415.527344\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"449.316406\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"512.939453\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"576.5625\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"608.349609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"671.972656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"735.595703\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"769.287109\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"832.910156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"896.533203\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"930.224609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"993.847656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 255.482813 333.36 \n",
       "L 255.482813 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_8\"/>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 2019-04-30 00:00:00 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(211.071407 399.81544)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2234 1581 \n",
       "L 2234 4063 \n",
       "L 641 1581 \n",
       "L 2234 1581 \n",
       "z\n",
       "M 3609 0 \n",
       "L 1484 0 \n",
       "L 1484 331 \n",
       "L 2234 331 \n",
       "L 2234 1247 \n",
       "L 197 1247 \n",
       "L 197 1588 \n",
       "L 2241 4750 \n",
       "L 2859 4750 \n",
       "L 2859 1581 \n",
       "L 3750 1581 \n",
       "L 3750 1247 \n",
       "L 2859 1247 \n",
       "L 2859 331 \n",
       "L 3609 331 \n",
       "L 3609 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"351.904297\" xlink:href=\"#DejaVuSerif-34\"/>\n",
       "       <use x=\"415.527344\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"449.316406\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"512.939453\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"576.5625\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"608.349609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"671.972656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"735.595703\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"769.287109\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"832.910156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"896.533203\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"930.224609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"993.847656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 317.482813 333.36 \n",
       "L 317.482813 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_10\"/>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 2019-05-31 00:00:00 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(273.071407 399.81544)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3219 4666 \n",
       "L 3219 4153 \n",
       "L 1081 4153 \n",
       "L 1081 2816 \n",
       "Q 1244 2928 1461 2984 \n",
       "Q 1678 3041 1947 3041 \n",
       "Q 2703 3041 3140 2622 \n",
       "Q 3578 2203 3578 1478 \n",
       "Q 3578 738 3136 323 \n",
       "Q 2694 -91 1894 -91 \n",
       "Q 1572 -91 1234 -12 \n",
       "Q 897 66 544 225 \n",
       "L 544 1131 \n",
       "L 897 1131 \n",
       "Q 925 688 1179 453 \n",
       "Q 1434 219 1894 219 \n",
       "Q 2388 219 2653 544 \n",
       "Q 2919 869 2919 1478 \n",
       "Q 2919 2084 2655 2407 \n",
       "Q 2391 2731 1894 2731 \n",
       "Q 1613 2731 1398 2631 \n",
       "Q 1184 2531 1019 2322 \n",
       "L 750 2322 \n",
       "L 750 4666 \n",
       "L 3219 4666 \n",
       "z\n",
       "\" id=\"DejaVuSerif-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"351.904297\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "       <use x=\"415.527344\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"449.316406\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"512.939453\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"576.5625\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"608.349609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"671.972656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"735.595703\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"769.287109\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"832.910156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"896.533203\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"930.224609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"993.847656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 379.482813 333.36 \n",
       "L 379.482813 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\"/>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 2019-06-30 00:00:00 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(335.071407 399.81544)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2094 219 \n",
       "Q 2534 219 2771 542 \n",
       "Q 3009 866 3009 1472 \n",
       "Q 3009 2078 2771 2401 \n",
       "Q 2534 2725 2094 2725 \n",
       "Q 1647 2725 1412 2412 \n",
       "Q 1178 2100 1178 1509 \n",
       "Q 1178 888 1415 553 \n",
       "Q 1653 219 2094 219 \n",
       "z\n",
       "M 1075 2569 \n",
       "Q 1288 2803 1556 2918 \n",
       "Q 1825 3034 2163 3034 \n",
       "Q 2859 3034 3264 2615 \n",
       "Q 3669 2197 3669 1472 \n",
       "Q 3669 763 3233 336 \n",
       "Q 2797 -91 2069 -91 \n",
       "Q 1278 -91 853 498 \n",
       "Q 428 1088 428 2181 \n",
       "Q 428 3406 931 4078 \n",
       "Q 1434 4750 2350 4750 \n",
       "Q 2597 4750 2869 4703 \n",
       "Q 3141 4656 3425 4563 \n",
       "L 3425 3794 \n",
       "L 3072 3794 \n",
       "Q 3034 4109 2831 4275 \n",
       "Q 2628 4441 2284 4441 \n",
       "Q 1678 4441 1381 3981 \n",
       "Q 1084 3522 1075 2569 \n",
       "z\n",
       "\" id=\"DejaVuSerif-36\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"351.904297\" xlink:href=\"#DejaVuSerif-36\"/>\n",
       "       <use x=\"415.527344\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"449.316406\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"512.939453\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"576.5625\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"608.349609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"671.972656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"735.595703\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"769.287109\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"832.910156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"896.533203\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"930.224609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"993.847656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 441.482813 333.36 \n",
       "L 441.482813 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\"/>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 2019-07-31 00:00:00 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(397.071407 399.81544)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3609 4347 \n",
       "L 1784 0 \n",
       "L 1319 0 \n",
       "L 3059 4153 \n",
       "L 903 4153 \n",
       "L 903 3578 \n",
       "L 538 3578 \n",
       "L 538 4666 \n",
       "L 3609 4666 \n",
       "L 3609 4347 \n",
       "z\n",
       "\" id=\"DejaVuSerif-37\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"351.904297\" xlink:href=\"#DejaVuSerif-37\"/>\n",
       "       <use x=\"415.527344\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"449.316406\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"512.939453\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"576.5625\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"608.349609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"671.972656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"735.595703\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"769.287109\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"832.910156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"896.533203\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"930.224609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"993.847656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_8\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 503.482813 333.36 \n",
       "L 503.482813 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\"/>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 2019-08-31 00:00:00 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(459.071407 399.81544)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"351.904297\" xlink:href=\"#DejaVuSerif-38\"/>\n",
       "       <use x=\"415.527344\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"449.316406\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"512.939453\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"576.5625\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"608.349609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"671.972656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"735.595703\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"769.287109\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"832.910156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"896.533203\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"930.224609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"993.847656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_9\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 565.482813 333.36 \n",
       "L 565.482813 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\"/>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 2019-09-30 00:00:00 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(521.071407 399.81544)rotate(-30)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "       <use x=\"254.492188\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"288.28125\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"351.904297\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "       <use x=\"415.527344\" xlink:href=\"#DejaVuSerif-2d\"/>\n",
       "       <use x=\"449.316406\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "       <use x=\"512.939453\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"576.5625\" xlink:href=\"#DejaVuSerif-20\"/>\n",
       "       <use x=\"608.349609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"671.972656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"735.595703\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"769.287109\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"832.910156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"896.533203\" xlink:href=\"#DejaVuSerif-3a\"/>\n",
       "       <use x=\"930.224609\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"993.847656\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 38.482813 296.550784 \n",
       "L 596.482813 296.550784 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_20\"/>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- −1.5 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 300.350003)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 678 2259 \n",
       "L 4684 2259 \n",
       "L 4684 1753 \n",
       "L 678 1753 \n",
       "L 678 2259 \n",
       "z\n",
       "\" id=\"DejaVuSerif-2212\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 603 325 \n",
       "Q 603 500 722 622 \n",
       "Q 841 744 1019 744 \n",
       "Q 1191 744 1312 622 \n",
       "Q 1434 500 1434 325 \n",
       "Q 1434 153 1312 31 \n",
       "Q 1191 -91 1019 -91 \n",
       "Q 841 -91 722 29 \n",
       "Q 603 150 603 325 \n",
       "z\n",
       "\" id=\"DejaVuSerif-2e\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-2212\"/>\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 38.482813 252.541976 \n",
       "L 596.482813 252.541976 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_22\"/>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- −1.0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 256.341195)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-2212\"/>\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_23\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 38.482813 208.533168 \n",
       "L 596.482813 208.533168 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_24\"/>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- −0.5 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 212.332387)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-2212\"/>\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_25\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 38.482813 164.52436 \n",
       "L 596.482813 164.52436 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_26\"/>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 0.0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 168.323579)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_27\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 38.482813 120.515552 \n",
       "L 596.482813 120.515552 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_28\"/>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 0.5 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 124.314771)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_29\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 38.482813 76.506745 \n",
       "L 596.482813 76.506745 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_30\"/>\n",
       "     <g id=\"text_15\">\n",
       "      <!-- 1.0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 80.305963)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_31\">\n",
       "      <path clip-path=\"url(#pa8688d4e13)\" d=\"M 38.482813 32.497937 \n",
       "L 596.482813 32.497937 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_32\"/>\n",
       "     <g id=\"text_16\">\n",
       "      <!-- 1.5 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 36.297155)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 53.982813 164.52436 \n",
       "L 61.732813 164.52436 \n",
       "L 61.732813 318.534545 \n",
       "L 53.982813 318.534545 \n",
       "z\n",
       "\" style=\"fill:#4c72b0;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 115.982813 164.52436 \n",
       "L 123.732813 164.52436 \n",
       "L 123.732813 78.150844 \n",
       "L 115.982813 78.150844 \n",
       "z\n",
       "\" style=\"fill:#4c72b0;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 177.982813 164.52436 \n",
       "L 185.732813 164.52436 \n",
       "L 185.732813 181.203332 \n",
       "L 177.982813 181.203332 \n",
       "z\n",
       "\" style=\"fill:#4c72b0;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 239.982813 164.52436 \n",
       "L 247.732813 164.52436 \n",
       "L 247.732813 215.891005 \n",
       "L 239.982813 215.891005 \n",
       "z\n",
       "\" style=\"fill:#4c72b0;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_7\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 301.982813 164.52436 \n",
       "L 309.732813 164.52436 \n",
       "L 309.732813 211.286392 \n",
       "L 301.982813 211.286392 \n",
       "z\n",
       "\" style=\"fill:#4c72b0;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_8\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 363.982813 164.52436 \n",
       "L 371.732813 164.52436 \n",
       "L 371.732813 22.025455 \n",
       "L 363.982813 22.025455 \n",
       "z\n",
       "\" style=\"fill:#4c72b0;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_9\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 425.982813 164.52436 \n",
       "L 433.732813 164.52436 \n",
       "L 433.732813 148.283465 \n",
       "L 425.982813 148.283465 \n",
       "z\n",
       "\" style=\"fill:#4c72b0;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_10\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 487.982813 164.52436 \n",
       "L 495.732813 164.52436 \n",
       "L 495.732813 193.239056 \n",
       "L 487.982813 193.239056 \n",
       "z\n",
       "\" style=\"fill:#4c72b0;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_11\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 549.982813 164.52436 \n",
       "L 557.732813 164.52436 \n",
       "L 557.732813 231.096687 \n",
       "L 549.982813 231.096687 \n",
       "z\n",
       "\" style=\"fill:#4c72b0;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_12\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 61.732813 164.52436 \n",
       "L 69.482813 164.52436 \n",
       "L 69.482813 134.362448 \n",
       "L 61.732813 134.362448 \n",
       "z\n",
       "\" style=\"fill:#55a868;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_13\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 123.732813 164.52436 \n",
       "L 131.482813 164.52436 \n",
       "L 131.482813 119.264044 \n",
       "L 123.732813 119.264044 \n",
       "z\n",
       "\" style=\"fill:#55a868;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_14\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 185.732813 164.52436 \n",
       "L 193.482813 164.52436 \n",
       "L 193.482813 142.079741 \n",
       "L 185.732813 142.079741 \n",
       "z\n",
       "\" style=\"fill:#55a868;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_15\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 247.732813 164.52436 \n",
       "L 255.482813 164.52436 \n",
       "L 255.482813 92.627429 \n",
       "L 247.732813 92.627429 \n",
       "z\n",
       "\" style=\"fill:#55a868;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_16\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 309.732813 164.52436 \n",
       "L 317.482813 164.52436 \n",
       "L 317.482813 73.889744 \n",
       "L 309.732813 73.889744 \n",
       "z\n",
       "\" style=\"fill:#55a868;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_17\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 371.732813 164.52436 \n",
       "L 379.482813 164.52436 \n",
       "L 379.482813 28.835948 \n",
       "L 371.732813 28.835948 \n",
       "z\n",
       "\" style=\"fill:#55a868;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_18\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 433.732813 164.52436 \n",
       "L 441.482813 164.52436 \n",
       "L 441.482813 82.044619 \n",
       "L 433.732813 82.044619 \n",
       "z\n",
       "\" style=\"fill:#55a868;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_19\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 495.732813 164.52436 \n",
       "L 503.482813 164.52436 \n",
       "L 503.482813 159.62389 \n",
       "L 495.732813 159.62389 \n",
       "z\n",
       "\" style=\"fill:#55a868;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_20\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 557.732813 164.52436 \n",
       "L 565.482813 164.52436 \n",
       "L 565.482813 92.662025 \n",
       "L 557.732813 92.662025 \n",
       "z\n",
       "\" style=\"fill:#55a868;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_21\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 69.482813 164.52436 \n",
       "L 77.232813 164.52436 \n",
       "L 77.232813 63.036898 \n",
       "L 69.482813 63.036898 \n",
       "z\n",
       "\" style=\"fill:#c44e52;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_22\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 131.482813 164.52436 \n",
       "L 139.232813 164.52436 \n",
       "L 139.232813 145.056653 \n",
       "L 131.482813 145.056653 \n",
       "z\n",
       "\" style=\"fill:#c44e52;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_23\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 193.482813 164.52436 \n",
       "L 201.232813 164.52436 \n",
       "L 201.232813 204.838804 \n",
       "L 193.482813 204.838804 \n",
       "z\n",
       "\" style=\"fill:#c44e52;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_24\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 255.482813 164.52436 \n",
       "L 263.232813 164.52436 \n",
       "L 263.232813 105.313079 \n",
       "L 255.482813 105.313079 \n",
       "z\n",
       "\" style=\"fill:#c44e52;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_25\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 317.482813 164.52436 \n",
       "L 325.232813 164.52436 \n",
       "L 325.232813 203.088013 \n",
       "L 317.482813 203.088013 \n",
       "z\n",
       "\" style=\"fill:#c44e52;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_26\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 379.482813 164.52436 \n",
       "L 387.232813 164.52436 \n",
       "L 387.232813 186.694162 \n",
       "L 379.482813 186.694162 \n",
       "z\n",
       "\" style=\"fill:#c44e52;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_27\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 441.482813 164.52436 \n",
       "L 449.232813 164.52436 \n",
       "L 449.232813 100.183453 \n",
       "L 441.482813 100.183453 \n",
       "z\n",
       "\" style=\"fill:#c44e52;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_28\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 503.482813 164.52436 \n",
       "L 511.232813 164.52436 \n",
       "L 511.232813 144.949277 \n",
       "L 503.482813 144.949277 \n",
       "z\n",
       "\" style=\"fill:#c44e52;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_29\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 565.482813 164.52436 \n",
       "L 573.232813 164.52436 \n",
       "L 573.232813 98.472002 \n",
       "L 565.482813 98.472002 \n",
       "z\n",
       "\" style=\"fill:#c44e52;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_30\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 77.232813 164.52436 \n",
       "L 84.982813 164.52436 \n",
       "L 84.982813 186.743178 \n",
       "L 77.232813 186.743178 \n",
       "z\n",
       "\" style=\"fill:#8172b2;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_31\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 139.232813 164.52436 \n",
       "L 146.982813 164.52436 \n",
       "L 146.982813 258.707023 \n",
       "L 139.232813 258.707023 \n",
       "z\n",
       "\" style=\"fill:#8172b2;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_32\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 201.232813 164.52436 \n",
       "L 208.982813 164.52436 \n",
       "L 208.982813 126.222308 \n",
       "L 201.232813 126.222308 \n",
       "z\n",
       "\" style=\"fill:#8172b2;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_33\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 263.232813 164.52436 \n",
       "L 270.982813 164.52436 \n",
       "L 270.982813 173.71438 \n",
       "L 263.232813 173.71438 \n",
       "z\n",
       "\" style=\"fill:#8172b2;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_34\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 325.232813 164.52436 \n",
       "L 332.982813 164.52436 \n",
       "L 332.982813 262.956066 \n",
       "L 325.232813 262.956066 \n",
       "z\n",
       "\" style=\"fill:#8172b2;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_35\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 387.232813 164.52436 \n",
       "L 394.982813 164.52436 \n",
       "L 394.982813 238.673545 \n",
       "L 387.232813 238.673545 \n",
       "z\n",
       "\" style=\"fill:#8172b2;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_36\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 449.232813 164.52436 \n",
       "L 456.982813 164.52436 \n",
       "L 456.982813 44.683436 \n",
       "L 449.232813 44.683436 \n",
       "z\n",
       "\" style=\"fill:#8172b2;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_37\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 511.232813 164.52436 \n",
       "L 518.982813 164.52436 \n",
       "L 518.982813 291.552879 \n",
       "L 511.232813 291.552879 \n",
       "z\n",
       "\" style=\"fill:#8172b2;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_38\">\n",
       "    <path clip-path=\"url(#pa8688d4e13)\" d=\"M 573.232813 164.52436 \n",
       "L 580.982813 164.52436 \n",
       "L 580.982813 204.655722 \n",
       "L 573.232813 204.655722 \n",
       "z\n",
       "\" style=\"fill:#8172b2;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_39\">\n",
       "    <path d=\"M 38.482813 333.36 \n",
       "L 38.482813 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_40\">\n",
       "    <path d=\"M 596.482813 333.36 \n",
       "L 596.482813 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_41\">\n",
       "    <path d=\"M 38.482813 333.36 \n",
       "L 596.482813 333.36 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_42\">\n",
       "    <path d=\"M 38.482813 7.2 \n",
       "L 596.482813 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"patch_43\">\n",
       "     <path d=\"M 538.35 23.798437 \n",
       "L 558.35 23.798437 \n",
       "L 558.35 16.798437 \n",
       "L 538.35 16.798437 \n",
       "z\n",
       "\" style=\"fill:#4c72b0;\"/>\n",
       "    </g>\n",
       "    <g id=\"text_17\">\n",
       "     <!-- No1 -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(566.35 23.798437)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 313 0 \n",
       "L 313 331 \n",
       "L 941 331 \n",
       "L 941 4331 \n",
       "L 313 4331 \n",
       "L 313 4666 \n",
       "L 1509 4666 \n",
       "L 4306 984 \n",
       "L 4306 4331 \n",
       "L 3681 4331 \n",
       "L 3681 4666 \n",
       "L 5319 4666 \n",
       "L 5319 4331 \n",
       "L 4691 4331 \n",
       "L 4691 -91 \n",
       "L 4313 -91 \n",
       "L 1325 3841 \n",
       "L 1325 331 \n",
       "L 1953 331 \n",
       "L 1953 0 \n",
       "L 313 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-4e\" transform=\"scale(0.015625)\"/>\n",
       "       <path d=\"M 1925 219 \n",
       "Q 2388 219 2623 584 \n",
       "Q 2859 950 2859 1663 \n",
       "Q 2859 2375 2623 2739 \n",
       "Q 2388 3103 1925 3103 \n",
       "Q 1463 3103 1227 2739 \n",
       "Q 991 2375 991 1663 \n",
       "Q 991 950 1228 584 \n",
       "Q 1466 219 1925 219 \n",
       "z\n",
       "M 1925 -91 \n",
       "Q 1200 -91 759 389 \n",
       "Q 319 869 319 1663 \n",
       "Q 319 2456 758 2934 \n",
       "Q 1197 3413 1925 3413 \n",
       "Q 2653 3413 3092 2934 \n",
       "Q 3531 2456 3531 1663 \n",
       "Q 3531 869 3092 389 \n",
       "Q 2653 -91 1925 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6f\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSerif-4e\"/>\n",
       "      <use x=\"87.5\" xlink:href=\"#DejaVuSerif-6f\"/>\n",
       "      <use x=\"147.705078\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"patch_44\">\n",
       "     <path d=\"M 538.35 38.476562 \n",
       "L 558.35 38.476562 \n",
       "L 558.35 31.476562 \n",
       "L 538.35 31.476562 \n",
       "z\n",
       "\" style=\"fill:#55a868;\"/>\n",
       "    </g>\n",
       "    <g id=\"text_18\">\n",
       "     <!-- No2 -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(566.35 38.476562)scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSerif-4e\"/>\n",
       "      <use x=\"87.5\" xlink:href=\"#DejaVuSerif-6f\"/>\n",
       "      <use x=\"147.705078\" xlink:href=\"#DejaVuSerif-32\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"patch_45\">\n",
       "     <path d=\"M 538.35 53.154687 \n",
       "L 558.35 53.154687 \n",
       "L 558.35 46.154687 \n",
       "L 538.35 46.154687 \n",
       "z\n",
       "\" style=\"fill:#c44e52;\"/>\n",
       "    </g>\n",
       "    <g id=\"text_19\">\n",
       "     <!-- No3 -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(566.35 53.154687)scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSerif-4e\"/>\n",
       "      <use x=\"87.5\" xlink:href=\"#DejaVuSerif-6f\"/>\n",
       "      <use x=\"147.705078\" xlink:href=\"#DejaVuSerif-33\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"patch_46\">\n",
       "     <path d=\"M 538.35 67.832812 \n",
       "L 558.35 67.832812 \n",
       "L 558.35 60.832812 \n",
       "L 538.35 60.832812 \n",
       "z\n",
       "\" style=\"fill:#8172b2;\"/>\n",
       "    </g>\n",
       "    <g id=\"text_20\">\n",
       "     <!-- No4 -->\n",
       "     <g style=\"fill:#262626;\" transform=\"translate(566.35 67.832812)scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSerif-4e\"/>\n",
       "      <use x=\"87.5\" xlink:href=\"#DejaVuSerif-6f\"/>\n",
       "      <use x=\"147.705078\" xlink:href=\"#DejaVuSerif-34\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pa8688d4e13\">\n",
       "   <rect height=\"326.16\" width=\"558\" x=\"38.482813\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df.plot.bar(figsize=(10, 6), rot=30);  \n",
    "# df.plot(kind='bar', figsize=(10, 6))  \n",
    "# plt.savefig('../../images/ch05/pd_plot_02.png')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Series Class"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {
    "uuid": "e86f82d1-5934-42d3-a986-f01bc829adaa"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.frame.DataFrame"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [],
   "source": [
    "S = pd.Series(np.linspace(0, 15, 7), name='series')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     0.0\n",
       "1     2.5\n",
       "2     5.0\n",
       "3     7.5\n",
       "4    10.0\n",
       "5    12.5\n",
       "6    15.0\n",
       "Name: series, dtype: float64"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "S"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(S)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "s = df['No1']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2019-01-31   -1.749765\n",
       "2019-02-28    0.981321\n",
       "2019-03-31   -0.189496\n",
       "2019-04-30   -0.583595\n",
       "2019-05-31   -0.531280\n",
       "2019-06-30    1.618982\n",
       "2019-07-31    0.184519\n",
       "2019-08-31   -0.326238\n",
       "2019-09-30   -0.756352\n",
       "Freq: M, Name: No1, dtype: float64"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {
    "uuid": "ca241ef9-5359-4c89-bc92-be6346cb3959"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(s)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.15021177307319458"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {
    "uuid": "b3d4cc90-e499-459c-88a5-011fde80d864"
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"368.435938pt\" version=\"1.1\" viewBox=\"0 0 613.267969 368.435938\" width=\"613.267969pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-08-08T13:05:45.787166</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.1, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 368.435938 \n",
       "L 613.267969 368.435938 \n",
       "L 613.267969 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 38.482813 333.36 \n",
       "L 596.482813 333.36 \n",
       "L 596.482813 7.2 \n",
       "L 38.482813 7.2 \n",
       "z\n",
       "\" style=\"fill:#eaeaf2;\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <path clip-path=\"url(#pa2dfea10c8)\" d=\"M 38.482812 333.36 \n",
       "L 38.482812 7.2 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_2\"/>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- Jan -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(30.276562 347.958438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M -538 -1119 \n",
       "L -538 -384 \n",
       "L -181 -384 \n",
       "Q -172 -694 -34 -845 \n",
       "Q 103 -997 378 -997 \n",
       "Q 750 -997 897 -762 \n",
       "Q 1044 -528 1044 153 \n",
       "L 1044 4331 \n",
       "L 319 4331 \n",
       "L 319 4666 \n",
       "L 2272 4666 \n",
       "L 2272 4331 \n",
       "L 1678 4331 \n",
       "L 1678 128 \n",
       "Q 1678 -644 1368 -987 \n",
       "Q 1059 -1331 372 -1331 \n",
       "Q 150 -1331 -79 -1278 \n",
       "Q -309 -1225 -538 -1119 \n",
       "z\n",
       "\" id=\"DejaVuSerif-4a\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 2547 1044 \n",
       "L 2547 1747 \n",
       "L 1806 1747 \n",
       "Q 1378 1747 1168 1562 \n",
       "Q 959 1378 959 997 \n",
       "Q 959 650 1171 447 \n",
       "Q 1384 244 1747 244 \n",
       "Q 2106 244 2326 466 \n",
       "Q 2547 688 2547 1044 \n",
       "z\n",
       "M 3122 2075 \n",
       "L 3122 331 \n",
       "L 3634 331 \n",
       "L 3634 0 \n",
       "L 2547 0 \n",
       "L 2547 359 \n",
       "Q 2356 128 2106 18 \n",
       "Q 1856 -91 1522 -91 \n",
       "Q 969 -91 644 203 \n",
       "Q 319 497 319 997 \n",
       "Q 319 1513 691 1797 \n",
       "Q 1063 2081 1741 2081 \n",
       "L 2547 2081 \n",
       "L 2547 2309 \n",
       "Q 2547 2688 2317 2895 \n",
       "Q 2088 3103 1672 3103 \n",
       "Q 1328 3103 1125 2947 \n",
       "Q 922 2791 872 2484 \n",
       "L 575 2484 \n",
       "L 575 3156 \n",
       "Q 875 3284 1158 3348 \n",
       "Q 1441 3413 1709 3413 \n",
       "Q 2400 3413 2761 3070 \n",
       "Q 3122 2728 3122 2075 \n",
       "z\n",
       "\" id=\"DejaVuSerif-61\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 263 0 \n",
       "L 263 331 \n",
       "L 781 331 \n",
       "L 781 2988 \n",
       "L 231 2988 \n",
       "L 231 3322 \n",
       "L 1356 3322 \n",
       "L 1356 2731 \n",
       "Q 1516 3069 1770 3241 \n",
       "Q 2025 3413 2363 3413 \n",
       "Q 2913 3413 3172 3097 \n",
       "Q 3431 2781 3431 2113 \n",
       "L 3431 331 \n",
       "L 3944 331 \n",
       "L 3944 0 \n",
       "L 2356 0 \n",
       "L 2356 331 \n",
       "L 2853 331 \n",
       "L 2853 1931 \n",
       "Q 2853 2541 2703 2767 \n",
       "Q 2553 2994 2175 2994 \n",
       "Q 1775 2994 1565 2701 \n",
       "Q 1356 2409 1356 1850 \n",
       "L 1356 331 \n",
       "L 1856 331 \n",
       "L 1856 0 \n",
       "L 263 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6e\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4a\"/>\n",
       "       <use x=\"40.087891\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "       <use x=\"99.707031\" xlink:href=\"#DejaVuSerif-6e\"/>\n",
       "      </g>\n",
       "      <!-- 2019 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(25.757812 359.15625)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 819 3553 \n",
       "L 469 3553 \n",
       "L 469 4384 \n",
       "Q 803 4563 1142 4656 \n",
       "Q 1481 4750 1806 4750 \n",
       "Q 2534 4750 2956 4397 \n",
       "Q 3378 4044 3378 3438 \n",
       "Q 3378 2753 2422 1800 \n",
       "Q 2347 1728 2309 1691 \n",
       "L 1131 513 \n",
       "L 3078 513 \n",
       "L 3078 1088 \n",
       "L 3444 1088 \n",
       "L 3444 0 \n",
       "L 434 0 \n",
       "L 434 341 \n",
       "L 1850 1753 \n",
       "Q 2319 2222 2519 2614 \n",
       "Q 2719 3006 2719 3438 \n",
       "Q 2719 3909 2473 4175 \n",
       "Q 2228 4441 1797 4441 \n",
       "Q 1350 4441 1106 4219 \n",
       "Q 863 3997 819 3553 \n",
       "z\n",
       "\" id=\"DejaVuSerif-32\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 2034 219 \n",
       "Q 2513 219 2750 744 \n",
       "Q 2988 1269 2988 2328 \n",
       "Q 2988 3391 2750 3916 \n",
       "Q 2513 4441 2034 4441 \n",
       "Q 1556 4441 1318 3916 \n",
       "Q 1081 3391 1081 2328 \n",
       "Q 1081 1269 1318 744 \n",
       "Q 1556 219 2034 219 \n",
       "z\n",
       "M 2034 -91 \n",
       "Q 1275 -91 848 546 \n",
       "Q 422 1184 422 2328 \n",
       "Q 422 3475 848 4112 \n",
       "Q 1275 4750 2034 4750 \n",
       "Q 2797 4750 3222 4112 \n",
       "Q 3647 3475 3647 2328 \n",
       "Q 3647 1184 3222 546 \n",
       "Q 2797 -91 2034 -91 \n",
       "z\n",
       "\" id=\"DejaVuSerif-30\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 909 0 \n",
       "L 909 331 \n",
       "L 1722 331 \n",
       "L 1722 4213 \n",
       "L 781 3603 \n",
       "L 781 4013 \n",
       "L 1919 4750 \n",
       "L 2350 4750 \n",
       "L 2350 331 \n",
       "L 3163 331 \n",
       "L 3163 0 \n",
       "L 909 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-31\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 2994 2091 \n",
       "Q 2784 1856 2512 1740 \n",
       "Q 2241 1625 1900 1625 \n",
       "Q 1206 1625 804 2044 \n",
       "Q 403 2463 403 3188 \n",
       "Q 403 3897 839 4323 \n",
       "Q 1275 4750 2003 4750 \n",
       "Q 2794 4750 3217 4161 \n",
       "Q 3641 3572 3641 2478 \n",
       "Q 3641 1253 3137 581 \n",
       "Q 2634 -91 1722 -91 \n",
       "Q 1475 -91 1203 -44 \n",
       "Q 931 3 647 97 \n",
       "L 647 872 \n",
       "L 997 872 \n",
       "Q 1038 556 1241 387 \n",
       "Q 1444 219 1784 219 \n",
       "Q 2391 219 2687 676 \n",
       "Q 2984 1134 2994 2091 \n",
       "z\n",
       "M 1978 4441 \n",
       "Q 1534 4441 1298 4117 \n",
       "Q 1063 3794 1063 3188 \n",
       "Q 1063 2581 1298 2256 \n",
       "Q 1534 1931 1978 1931 \n",
       "Q 2422 1931 2658 2245 \n",
       "Q 2894 2559 2894 3150 \n",
       "Q 2894 3772 2656 4106 \n",
       "Q 2419 4441 1978 4441 \n",
       "z\n",
       "\" id=\"DejaVuSerif-39\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"127.246094\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"190.869141\" xlink:href=\"#DejaVuSerif-39\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_3\"/>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- Feb -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(98.878125 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 353 0 \n",
       "L 353 331 \n",
       "L 947 331 \n",
       "L 947 4331 \n",
       "L 353 4331 \n",
       "L 353 4666 \n",
       "L 4172 4666 \n",
       "L 4172 3628 \n",
       "L 3788 3628 \n",
       "L 3788 4281 \n",
       "L 1581 4281 \n",
       "L 1581 2719 \n",
       "L 3175 2719 \n",
       "L 3175 3303 \n",
       "L 3559 3303 \n",
       "L 3559 1753 \n",
       "L 3175 1753 \n",
       "L 3175 2338 \n",
       "L 1581 2338 \n",
       "L 1581 331 \n",
       "L 2328 331 \n",
       "L 2328 0 \n",
       "L 353 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-46\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 3469 1600 \n",
       "L 991 1600 \n",
       "L 991 1575 \n",
       "Q 991 903 1244 561 \n",
       "Q 1497 219 1991 219 \n",
       "Q 2369 219 2611 417 \n",
       "Q 2853 616 2950 1006 \n",
       "L 3413 1006 \n",
       "Q 3275 459 2904 184 \n",
       "Q 2534 -91 1931 -91 \n",
       "Q 1203 -91 761 389 \n",
       "Q 319 869 319 1663 \n",
       "Q 319 2450 753 2931 \n",
       "Q 1188 3413 1894 3413 \n",
       "Q 2647 3413 3050 2948 \n",
       "Q 3453 2484 3469 1600 \n",
       "z\n",
       "M 2791 1931 \n",
       "Q 2772 2513 2545 2808 \n",
       "Q 2319 3103 1894 3103 \n",
       "Q 1497 3103 1269 2806 \n",
       "Q 1041 2509 991 1931 \n",
       "L 2791 1931 \n",
       "z\n",
       "\" id=\"DejaVuSerif-65\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 738 331 \n",
       "L 738 4531 \n",
       "L 184 4531 \n",
       "L 184 4863 \n",
       "L 1313 4863 \n",
       "L 1313 2803 \n",
       "Q 1481 3116 1742 3264 \n",
       "Q 2003 3413 2388 3413 \n",
       "Q 3000 3413 3387 2928 \n",
       "Q 3775 2444 3775 1663 \n",
       "Q 3775 881 3387 395 \n",
       "Q 3000 -91 2388 -91 \n",
       "Q 2003 -91 1742 57 \n",
       "Q 1481 206 1313 519 \n",
       "L 1313 0 \n",
       "L 184 0 \n",
       "L 184 331 \n",
       "L 738 331 \n",
       "z\n",
       "M 1313 1497 \n",
       "Q 1313 897 1542 583 \n",
       "Q 1772 269 2209 269 \n",
       "Q 2650 269 2876 622 \n",
       "Q 3103 975 3103 1663 \n",
       "Q 3103 2353 2876 2703 \n",
       "Q 2650 3053 2209 3053 \n",
       "Q 1772 3053 1542 2737 \n",
       "Q 1313 2422 1313 1825 \n",
       "L 1313 1497 \n",
       "z\n",
       "\" id=\"DejaVuSerif-62\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-46\"/>\n",
       "       <use x=\"63.884766\" xlink:href=\"#DejaVuSerif-65\"/>\n",
       "       <use x=\"123.064453\" xlink:href=\"#DejaVuSerif-62\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_4\"/>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- Mar -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(167.492187 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 353 0 \n",
       "L 353 331 \n",
       "L 947 331 \n",
       "L 947 4331 \n",
       "L 319 4331 \n",
       "L 319 4666 \n",
       "L 1678 4666 \n",
       "L 3316 1344 \n",
       "L 4953 4666 \n",
       "L 6228 4666 \n",
       "L 6228 4331 \n",
       "L 5606 4331 \n",
       "L 5606 331 \n",
       "L 6203 331 \n",
       "L 6203 0 \n",
       "L 4378 0 \n",
       "L 4378 331 \n",
       "L 4972 331 \n",
       "L 4972 3938 \n",
       "L 3372 684 \n",
       "L 2931 684 \n",
       "L 1331 3938 \n",
       "L 1331 331 \n",
       "L 1925 331 \n",
       "L 1925 0 \n",
       "L 353 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-4d\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 3059 3328 \n",
       "L 3059 2497 \n",
       "L 2728 2497 \n",
       "Q 2713 2744 2591 2866 \n",
       "Q 2469 2988 2234 2988 \n",
       "Q 1809 2988 1582 2694 \n",
       "Q 1356 2400 1356 1850 \n",
       "L 1356 331 \n",
       "L 2022 331 \n",
       "L 2022 0 \n",
       "L 263 0 \n",
       "L 263 331 \n",
       "L 781 331 \n",
       "L 781 2994 \n",
       "L 231 2994 \n",
       "L 231 3322 \n",
       "L 1356 3322 \n",
       "L 1356 2731 \n",
       "Q 1525 3078 1790 3245 \n",
       "Q 2056 3413 2438 3413 \n",
       "Q 2578 3413 2733 3391 \n",
       "Q 2888 3369 3059 3328 \n",
       "z\n",
       "\" id=\"DejaVuSerif-72\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4d\"/>\n",
       "       <use x=\"102.392578\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "       <use x=\"162.011719\" xlink:href=\"#DejaVuSerif-72\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_5\"/>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- Apr -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(238.53125 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1281 1691 \n",
       "L 2994 1691 \n",
       "L 2138 3909 \n",
       "L 1281 1691 \n",
       "z\n",
       "M -38 0 \n",
       "L -38 331 \n",
       "L 372 331 \n",
       "L 2034 4666 \n",
       "L 2559 4666 \n",
       "L 4225 331 \n",
       "L 4684 331 \n",
       "L 4684 0 \n",
       "L 2988 0 \n",
       "L 2988 331 \n",
       "L 3506 331 \n",
       "L 3116 1356 \n",
       "L 1153 1356 \n",
       "L 763 331 \n",
       "L 1275 331 \n",
       "L 1275 0 \n",
       "L -38 0 \n",
       "z\n",
       "\" id=\"DejaVuSerif-41\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 1313 1825 \n",
       "L 1313 1497 \n",
       "Q 1313 897 1542 583 \n",
       "Q 1772 269 2209 269 \n",
       "Q 2650 269 2876 622 \n",
       "Q 3103 975 3103 1663 \n",
       "Q 3103 2353 2876 2703 \n",
       "Q 2650 3053 2209 3053 \n",
       "Q 1772 3053 1542 2737 \n",
       "Q 1313 2422 1313 1825 \n",
       "z\n",
       "M 738 2988 \n",
       "L 184 2988 \n",
       "L 184 3322 \n",
       "L 1313 3322 \n",
       "L 1313 2803 \n",
       "Q 1481 3116 1742 3264 \n",
       "Q 2003 3413 2388 3413 \n",
       "Q 3000 3413 3387 2928 \n",
       "Q 3775 2444 3775 1663 \n",
       "Q 3775 881 3387 395 \n",
       "Q 3000 -91 2388 -91 \n",
       "Q 2003 -91 1742 57 \n",
       "Q 1481 206 1313 519 \n",
       "L 1313 -997 \n",
       "L 1856 -997 \n",
       "L 1856 -1331 \n",
       "L 184 -1331 \n",
       "L 184 -997 \n",
       "L 738 -997 \n",
       "L 738 2988 \n",
       "z\n",
       "\" id=\"DejaVuSerif-70\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-41\"/>\n",
       "       <use x=\"72.216797\" xlink:href=\"#DejaVuSerif-70\"/>\n",
       "       <use x=\"136.230469\" xlink:href=\"#DejaVuSerif-72\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_6\"/>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- May -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(306.557031 344.21625)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1381 -609 \n",
       "L 1600 -56 \n",
       "L 359 2988 \n",
       "L -19 2988 \n",
       "L -19 3322 \n",
       "L 1509 3322 \n",
       "L 1509 2988 \n",
       "L 978 2988 \n",
       "L 1913 703 \n",
       "L 2847 2988 \n",
       "L 2350 2988 \n",
       "L 2350 3322 \n",
       "L 3597 3322 \n",
       "L 3597 2988 \n",
       "L 3225 2988 \n",
       "L 1703 -750 \n",
       "Q 1547 -1138 1356 -1280 \n",
       "Q 1166 -1422 819 -1422 \n",
       "Q 672 -1422 517 -1397 \n",
       "Q 363 -1372 206 -1325 \n",
       "L 206 -691 \n",
       "L 500 -691 \n",
       "Q 519 -903 608 -995 \n",
       "Q 697 -1088 884 -1088 \n",
       "Q 1056 -1088 1161 -992 \n",
       "Q 1266 -897 1381 -609 \n",
       "z\n",
       "\" id=\"DejaVuSerif-79\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4d\"/>\n",
       "       <use x=\"102.392578\" xlink:href=\"#DejaVuSerif-61\"/>\n",
       "       <use x=\"162.011719\" xlink:href=\"#DejaVuSerif-79\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_7\"/>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- Jun -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(378.7875 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2266 3322 \n",
       "L 3341 3322 \n",
       "L 3341 331 \n",
       "L 3884 331 \n",
       "L 3884 0 \n",
       "L 2766 0 \n",
       "L 2766 588 \n",
       "Q 2606 256 2353 82 \n",
       "Q 2100 -91 1766 -91 \n",
       "Q 1213 -91 952 223 \n",
       "Q 691 538 691 1209 \n",
       "L 691 2988 \n",
       "L 172 2988 \n",
       "L 172 3322 \n",
       "L 1269 3322 \n",
       "L 1269 1388 \n",
       "Q 1269 781 1417 556 \n",
       "Q 1566 331 1947 331 \n",
       "Q 2347 331 2556 625 \n",
       "Q 2766 919 2766 1478 \n",
       "L 2766 2988 \n",
       "L 2266 2988 \n",
       "L 2266 3322 \n",
       "z\n",
       "\" id=\"DejaVuSerif-75\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4a\"/>\n",
       "       <use x=\"40.087891\" xlink:href=\"#DejaVuSerif-75\"/>\n",
       "       <use x=\"104.492188\" xlink:href=\"#DejaVuSerif-6e\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_8\"/>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- Jul -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(450.158594 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1313 331 \n",
       "L 1856 331 \n",
       "L 1856 0 \n",
       "L 184 0 \n",
       "L 184 331 \n",
       "L 738 331 \n",
       "L 738 4531 \n",
       "L 184 4531 \n",
       "L 184 4863 \n",
       "L 1313 4863 \n",
       "L 1313 331 \n",
       "z\n",
       "\" id=\"DejaVuSerif-6c\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-4a\"/>\n",
       "       <use x=\"40.087891\" xlink:href=\"#DejaVuSerif-75\"/>\n",
       "       <use x=\"104.492188\" xlink:href=\"#DejaVuSerif-6c\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_8\">\n",
       "     <g id=\"line2d_9\"/>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- Aug -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(516.700781 344.21625)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 3359 2988 \n",
       "L 3359 72 \n",
       "Q 3359 -644 2965 -1033 \n",
       "Q 2572 -1422 1844 -1422 \n",
       "Q 1516 -1422 1216 -1362 \n",
       "Q 916 -1303 641 -1184 \n",
       "L 641 -488 \n",
       "L 941 -488 \n",
       "Q 997 -813 1206 -963 \n",
       "Q 1416 -1113 1806 -1113 \n",
       "Q 2313 -1113 2548 -827 \n",
       "Q 2784 -541 2784 72 \n",
       "L 2784 519 \n",
       "Q 2616 206 2355 57 \n",
       "Q 2094 -91 1709 -91 \n",
       "Q 1097 -91 708 395 \n",
       "Q 319 881 319 1663 \n",
       "Q 319 2444 706 2928 \n",
       "Q 1094 3413 1709 3413 \n",
       "Q 2094 3413 2355 3264 \n",
       "Q 2616 3116 2784 2803 \n",
       "L 2784 3322 \n",
       "L 3909 3322 \n",
       "L 3909 2988 \n",
       "L 3359 2988 \n",
       "z\n",
       "M 2784 1825 \n",
       "Q 2784 2422 2554 2737 \n",
       "Q 2325 3053 1888 3053 \n",
       "Q 1444 3053 1217 2703 \n",
       "Q 991 2353 991 1663 \n",
       "Q 991 975 1217 622 \n",
       "Q 1444 269 1888 269 \n",
       "Q 2325 269 2554 583 \n",
       "Q 2784 897 2784 1497 \n",
       "L 2784 1825 \n",
       "z\n",
       "\" id=\"DejaVuSerif-67\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-41\"/>\n",
       "       <use x=\"72.216797\" xlink:href=\"#DejaVuSerif-75\"/>\n",
       "       <use x=\"136.621094\" xlink:href=\"#DejaVuSerif-67\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_9\">\n",
       "     <g id=\"line2d_10\"/>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- Sep -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(586.897656 344.358438)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 594 225 \n",
       "L 594 1288 \n",
       "L 953 1284 \n",
       "Q 969 753 1261 498 \n",
       "Q 1553 244 2150 244 \n",
       "Q 2706 244 2998 464 \n",
       "Q 3291 684 3291 1106 \n",
       "Q 3291 1444 3114 1625 \n",
       "Q 2938 1806 2369 1978 \n",
       "L 1753 2163 \n",
       "Q 1084 2366 811 2669 \n",
       "Q 538 2972 538 3500 \n",
       "Q 538 4094 959 4422 \n",
       "Q 1381 4750 2144 4750 \n",
       "Q 2469 4750 2856 4679 \n",
       "Q 3244 4609 3681 4475 \n",
       "L 3681 3481 \n",
       "L 3328 3481 \n",
       "Q 3275 3975 2998 4195 \n",
       "Q 2722 4416 2156 4416 \n",
       "Q 1663 4416 1405 4214 \n",
       "Q 1147 4013 1147 3628 \n",
       "Q 1147 3294 1340 3103 \n",
       "Q 1534 2913 2163 2725 \n",
       "L 2741 2553 \n",
       "Q 3375 2363 3645 2067 \n",
       "Q 3916 1772 3916 1275 \n",
       "Q 3916 597 3481 253 \n",
       "Q 3047 -91 2188 -91 \n",
       "Q 1803 -91 1404 -12 \n",
       "Q 1006 66 594 225 \n",
       "z\n",
       "\" id=\"DejaVuSerif-53\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-53\"/>\n",
       "       <use x=\"68.505859\" xlink:href=\"#DejaVuSerif-65\"/>\n",
       "       <use x=\"127.685547\" xlink:href=\"#DejaVuSerif-70\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <path clip-path=\"url(#pa2dfea10c8)\" d=\"M 38.482813 296.550784 \n",
       "L 596.482813 296.550784 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_12\"/>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- −1.5 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 300.350003)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 678 2259 \n",
       "L 4684 2259 \n",
       "L 4684 1753 \n",
       "L 678 1753 \n",
       "L 678 2259 \n",
       "z\n",
       "\" id=\"DejaVuSerif-2212\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 603 325 \n",
       "Q 603 500 722 622 \n",
       "Q 841 744 1019 744 \n",
       "Q 1191 744 1312 622 \n",
       "Q 1434 500 1434 325 \n",
       "Q 1434 153 1312 31 \n",
       "Q 1191 -91 1019 -91 \n",
       "Q 841 -91 722 29 \n",
       "Q 603 150 603 325 \n",
       "z\n",
       "\" id=\"DejaVuSerif-2e\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 3219 4666 \n",
       "L 3219 4153 \n",
       "L 1081 4153 \n",
       "L 1081 2816 \n",
       "Q 1244 2928 1461 2984 \n",
       "Q 1678 3041 1947 3041 \n",
       "Q 2703 3041 3140 2622 \n",
       "Q 3578 2203 3578 1478 \n",
       "Q 3578 738 3136 323 \n",
       "Q 2694 -91 1894 -91 \n",
       "Q 1572 -91 1234 -12 \n",
       "Q 897 66 544 225 \n",
       "L 544 1131 \n",
       "L 897 1131 \n",
       "Q 925 688 1179 453 \n",
       "Q 1434 219 1894 219 \n",
       "Q 2388 219 2653 544 \n",
       "Q 2919 869 2919 1478 \n",
       "Q 2919 2084 2655 2407 \n",
       "Q 2391 2731 1894 2731 \n",
       "Q 1613 2731 1398 2631 \n",
       "Q 1184 2531 1019 2322 \n",
       "L 750 2322 \n",
       "L 750 4666 \n",
       "L 3219 4666 \n",
       "z\n",
       "\" id=\"DejaVuSerif-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSerif-2212\"/>\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <path clip-path=\"url(#pa2dfea10c8)\" d=\"M 38.482813 252.541976 \n",
       "L 596.482813 252.541976 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_14\"/>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- −1.0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 256.341195)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-2212\"/>\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_15\">\n",
       "      <path clip-path=\"url(#pa2dfea10c8)\" d=\"M 38.482813 208.533168 \n",
       "L 596.482813 208.533168 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_16\"/>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- −0.5 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(7.2 212.332387)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-2212\"/>\n",
       "       <use x=\"83.789062\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"147.412109\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"179.199219\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_17\">\n",
       "      <path clip-path=\"url(#pa2dfea10c8)\" d=\"M 38.482813 164.52436 \n",
       "L 596.482813 164.52436 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_18\"/>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 0.0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 168.323579)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_19\">\n",
       "      <path clip-path=\"url(#pa2dfea10c8)\" d=\"M 38.482813 120.515552 \n",
       "L 596.482813 120.515552 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_20\"/>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 0.5 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 124.314771)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_21\">\n",
       "      <path clip-path=\"url(#pa2dfea10c8)\" d=\"M 38.482813 76.506745 \n",
       "L 596.482813 76.506745 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_22\"/>\n",
       "     <g id=\"text_15\">\n",
       "      <!-- 1.0 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 80.305963)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSerif-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_23\">\n",
       "      <path clip-path=\"url(#pa2dfea10c8)\" d=\"M 38.482813 32.497937 \n",
       "L 596.482813 32.497937 \n",
       "\" style=\"fill:none;stroke:#ffffff;stroke-linecap:round;\"/>\n",
       "     </g>\n",
       "     <g id=\"line2d_24\"/>\n",
       "     <g id=\"text_16\">\n",
       "      <!-- 1.5 -->\n",
       "      <g style=\"fill:#262626;\" transform=\"translate(15.579688 36.297155)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSerif-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSerif-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSerif-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_25\">\n",
       "    <path clip-path=\"url(#pa2dfea10c8)\" d=\"M 38.482812 318.534545 \n",
       "L 108.232812 78.150844 \n",
       "L 177.982812 181.203332 \n",
       "L 247.732812 215.891005 \n",
       "L 317.482812 211.286392 \n",
       "L 387.232812 22.025455 \n",
       "L 456.982812 148.283465 \n",
       "L 526.732812 193.239056 \n",
       "L 596.482812 231.096687 \n",
       "\" style=\"fill:none;stroke:#4c72b0;stroke-linecap:round;stroke-width:2;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 38.482813 333.36 \n",
       "L 38.482813 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 596.482813 333.36 \n",
       "L 596.482813 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 38.482812 333.36 \n",
       "L 596.482812 333.36 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 38.482812 7.2 \n",
       "L 596.482812 7.2 \n",
       "\" style=\"fill:none;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pa2dfea10c8\">\n",
       "   <rect height=\"326.16\" width=\"558\" x=\"38.482813\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 720x432 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "s.plot(lw=2.0, figsize=(10, 6));\n",
    "# plt.savefig('../../images/ch05/pd_plot_03.png')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## GroupBy Operations"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {
    "scrolled": true,
    "uuid": "4bc106dd-9590-4566-bc70-d410517c8223"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>No1</th>\n",
       "      <th>No2</th>\n",
       "      <th>No3</th>\n",
       "      <th>No4</th>\n",
       "      <th>Quarter</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2019-01-31</th>\n",
       "      <td>-1.749765</td>\n",
       "      <td>0.342680</td>\n",
       "      <td>1.153036</td>\n",
       "      <td>-0.252436</td>\n",
       "      <td>Q1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-02-28</th>\n",
       "      <td>0.981321</td>\n",
       "      <td>0.514219</td>\n",
       "      <td>0.221180</td>\n",
       "      <td>-1.070043</td>\n",
       "      <td>Q1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-03-31</th>\n",
       "      <td>-0.189496</td>\n",
       "      <td>0.255001</td>\n",
       "      <td>-0.458027</td>\n",
       "      <td>0.435163</td>\n",
       "      <td>Q1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-04-30</th>\n",
       "      <td>-0.583595</td>\n",
       "      <td>0.816847</td>\n",
       "      <td>0.672721</td>\n",
       "      <td>-0.104411</td>\n",
       "      <td>Q2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-05-31</th>\n",
       "      <td>-0.531280</td>\n",
       "      <td>1.029733</td>\n",
       "      <td>-0.438136</td>\n",
       "      <td>-1.118318</td>\n",
       "      <td>Q2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-06-30</th>\n",
       "      <td>1.618982</td>\n",
       "      <td>1.541605</td>\n",
       "      <td>-0.251879</td>\n",
       "      <td>-0.842436</td>\n",
       "      <td>Q2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-07-31</th>\n",
       "      <td>0.184519</td>\n",
       "      <td>0.937082</td>\n",
       "      <td>0.731000</td>\n",
       "      <td>1.361556</td>\n",
       "      <td>Q3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-08-31</th>\n",
       "      <td>-0.326238</td>\n",
       "      <td>0.055676</td>\n",
       "      <td>0.222400</td>\n",
       "      <td>-1.443217</td>\n",
       "      <td>Q3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2019-09-30</th>\n",
       "      <td>-0.756352</td>\n",
       "      <td>0.816454</td>\n",
       "      <td>0.750445</td>\n",
       "      <td>-0.455947</td>\n",
       "      <td>Q3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 No1       No2       No3       No4 Quarter\n",
       "2019-01-31 -1.749765  0.342680  1.153036 -0.252436      Q1\n",
       "2019-02-28  0.981321  0.514219  0.221180 -1.070043      Q1\n",
       "2019-03-31 -0.189496  0.255001 -0.458027  0.435163      Q1\n",
       "2019-04-30 -0.583595  0.816847  0.672721 -0.104411      Q2\n",
       "2019-05-31 -0.531280  1.029733 -0.438136 -1.118318      Q2\n",
       "2019-06-30  1.618982  1.541605 -0.251879 -0.842436      Q2\n",
       "2019-07-31  0.184519  0.937082  0.731000  1.361556      Q3\n",
       "2019-08-31 -0.326238  0.055676  0.222400 -1.443217      Q3\n",
       "2019-09-30 -0.756352  0.816454  0.750445 -0.455947      Q3"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['Quarter'] = ['Q1', 'Q1', 'Q1', 'Q2', 'Q2',\n",
    "                 'Q2', 'Q3', 'Q3', 'Q3']\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [],
   "source": [
    "groups = df.groupby('Quarter')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {
    "uuid": "a871b95e-5946-4b09-b8dc-bc9503d2ff14"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Quarter\n",
       "Q1    3\n",
       "Q2    3\n",
       "Q3    3\n",
       "dtype: int64"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "groups.size()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {
    "uuid": "804e567f-6b74-4405-a10e-d19d914655e7"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>No1</th>\n",
       "      <th>No2</th>\n",
       "      <th>No3</th>\n",
       "      <th>No4</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Quarter</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Q1</th>\n",
       "      <td>-0.319314</td>\n",
       "      <td>0.370634</td>\n",
       "      <td>0.305396</td>\n",
       "      <td>-0.295772</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Q2</th>\n",
       "      <td>0.168035</td>\n",
       "      <td>1.129395</td>\n",
       "      <td>-0.005765</td>\n",
       "      <td>-0.688388</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Q3</th>\n",
       "      <td>-0.299357</td>\n",
       "      <td>0.603071</td>\n",
       "      <td>0.567948</td>\n",
       "      <td>-0.179203</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              No1       No2       No3       No4\n",
       "Quarter                                        \n",
       "Q1      -0.319314  0.370634  0.305396 -0.295772\n",
       "Q2       0.168035  1.129395 -0.005765 -0.688388\n",
       "Q3      -0.299357  0.603071  0.567948 -0.179203"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "groups.mean()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {
    "uuid": "7eb45e5c-b86f-4464-afd9-d5a3665e0f8e"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>No1</th>\n",
       "      <th>No2</th>\n",
       "      <th>No3</th>\n",
       "      <th>No4</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Quarter</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Q1</th>\n",
       "      <td>0.981321</td>\n",
       "      <td>0.514219</td>\n",
       "      <td>1.153036</td>\n",
       "      <td>0.435163</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Q2</th>\n",
       "      <td>1.618982</td>\n",
       "      <td>1.541605</td>\n",
       "      <td>0.672721</td>\n",
       "      <td>-0.104411</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Q3</th>\n",
       "      <td>0.184519</td>\n",
       "      <td>0.937082</td>\n",
       "      <td>0.750445</td>\n",
       "      <td>1.361556</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              No1       No2       No3       No4\n",
       "Quarter                                        \n",
       "Q1       0.981321  0.514219  1.153036  0.435163\n",
       "Q2       1.618982  1.541605  0.672721 -0.104411\n",
       "Q3       0.184519  0.937082  0.750445  1.361556"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "groups.max()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr:last-of-type th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">No1</th>\n",
       "      <th colspan=\"2\" halign=\"left\">No2</th>\n",
       "      <th colspan=\"2\" halign=\"left\">No3</th>\n",
       "      <th colspan=\"2\" halign=\"left\">No4</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "      <th>min</th>\n",
       "      <th>max</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Quarter</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Q1</th>\n",
       "      <td>-1.75</td>\n",
       "      <td>0.98</td>\n",
       "      <td>0.26</td>\n",
       "      <td>0.51</td>\n",
       "      <td>-0.46</td>\n",
       "      <td>1.15</td>\n",
       "      <td>-1.07</td>\n",
       "      <td>0.44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Q2</th>\n",
       "      <td>-0.58</td>\n",
       "      <td>1.62</td>\n",
       "      <td>0.82</td>\n",
       "      <td>1.54</td>\n",
       "      <td>-0.44</td>\n",
       "      <td>0.67</td>\n",
       "      <td>-1.12</td>\n",
       "      <td>-0.10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Q3</th>\n",
       "      <td>-0.76</td>\n",
       "      <td>0.18</td>\n",
       "      <td>0.06</td>\n",
       "      <td>0.94</td>\n",
       "      <td>0.22</td>\n",
       "      <td>0.75</td>\n",
       "      <td>-1.44</td>\n",
       "      <td>1.36</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          No1         No2         No3         No4      \n",
       "          min   max   min   max   min   max   min   max\n",
       "Quarter                                                \n",
       "Q1      -1.75  0.98  0.26  0.51 -0.46  1.15 -1.07  0.44\n",
       "Q2      -0.58  1.62  0.82  1.54 -0.44  0.67 -1.12 -0.10\n",
       "Q3      -0.76  0.18  0.06  0.94  0.22  0.75 -1.44  1.36"
      ]
     },
     "execution_count": 69,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "groups.aggregate([min, max]).round(2)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {
    "uuid": "542cf99a-bbf8-447e-9643-d6887ac74be7"
   },
   "outputs": [],
   "source": [
    "df['Odd_Even'] = ['Odd', 'Even', 'Odd', 'Even', 'Odd', 'Even',\n",
    "                  'Odd', 'Even', 'Odd']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {
    "uuid": "f5144c9f-ff37-4e35-9417-e39debdcd45b"
   },
   "outputs": [],
   "source": [
    "groups = df.groupby(['Quarter', 'Odd_Even'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {
    "uuid": "06904508-dbf1-431f-a3a2-681f29f03c51"
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Quarter  Odd_Even\n",
       "Q1       Even        1\n",
       "         Odd         2\n",
       "Q2       Even        2\n",
       "         Odd         1\n",
       "Q3       Even        1\n",
       "         Odd         2\n",
       "dtype: int64"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "groups.size()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {
    "uuid": "b8471956-40fc-4203-a54a-aaa45f5a3c00"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr:last-of-type th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">No1</th>\n",
       "      <th colspan=\"2\" halign=\"left\">No4</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>sum</th>\n",
       "      <th>mean</th>\n",
       "      <th>sum</th>\n",
       "      <th>mean</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Quarter</th>\n",
       "      <th>Odd_Even</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">Q1</th>\n",
       "      <th>Even</th>\n",
       "      <td>0.981321</td>\n",
       "      <td>0.981321</td>\n",
       "      <td>-1.070043</td>\n",
       "      <td>-1.070043</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Odd</th>\n",
       "      <td>-1.939261</td>\n",
       "      <td>-0.969631</td>\n",
       "      <td>0.182727</td>\n",
       "      <td>0.091364</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">Q2</th>\n",
       "      <th>Even</th>\n",
       "      <td>1.035387</td>\n",
       "      <td>0.517693</td>\n",
       "      <td>-0.946847</td>\n",
       "      <td>-0.473423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Odd</th>\n",
       "      <td>-0.531280</td>\n",
       "      <td>-0.531280</td>\n",
       "      <td>-1.118318</td>\n",
       "      <td>-1.118318</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">Q3</th>\n",
       "      <th>Even</th>\n",
       "      <td>-0.326238</td>\n",
       "      <td>-0.326238</td>\n",
       "      <td>-1.443217</td>\n",
       "      <td>-1.443217</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Odd</th>\n",
       "      <td>-0.571834</td>\n",
       "      <td>-0.285917</td>\n",
       "      <td>0.905609</td>\n",
       "      <td>0.452805</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       No1                 No4          \n",
       "                       sum      mean       sum      mean\n",
       "Quarter Odd_Even                                        \n",
       "Q1      Even      0.981321  0.981321 -1.070043 -1.070043\n",
       "        Odd      -1.939261 -0.969631  0.182727  0.091364\n",
       "Q2      Even      1.035387  0.517693 -0.946847 -0.473423\n",
       "        Odd      -0.531280 -0.531280 -1.118318 -1.118318\n",
       "Q3      Even     -0.326238 -0.326238 -1.443217 -1.443217\n",
       "        Odd      -0.571834 -0.285917  0.905609  0.452805"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "groups[['No1', 'No4']].aggregate([sum, np.mean])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Complex Selection"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = np.random.standard_normal((10, 2))  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame(data, columns=['x', 'y'])  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 10 entries, 0 to 9\n",
      "Data columns (total 2 columns):\n",
      " #   Column  Non-Null Count  Dtype  \n",
      "---  ------  --------------  -----  \n",
      " 0   x       10 non-null     float64\n",
      " 1   y       10 non-null     float64\n",
      "dtypes: float64(2)\n",
      "memory usage: 288.0 bytes\n"
     ]
    }
   ],
   "source": [
    "df.info()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.189622</td>\n",
       "      <td>-1.690617</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-1.356399</td>\n",
       "      <td>-1.232435</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.544439</td>\n",
       "      <td>-0.668172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.007315</td>\n",
       "      <td>-0.612939</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.299748</td>\n",
       "      <td>-1.733096</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          x         y\n",
       "0  1.189622 -1.690617\n",
       "1 -1.356399 -1.232435\n",
       "2 -0.544439 -0.668172\n",
       "3  0.007315 -0.612939\n",
       "4  1.299748 -1.733096"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>-0.983310</td>\n",
       "      <td>0.357508</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>-1.613579</td>\n",
       "      <td>1.470714</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-1.188018</td>\n",
       "      <td>-0.549746</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>-0.940046</td>\n",
       "      <td>-0.827932</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.108863</td>\n",
       "      <td>0.507810</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          x         y\n",
       "5 -0.983310  0.357508\n",
       "6 -1.613579  1.470714\n",
       "7 -1.188018 -0.549746\n",
       "8 -0.940046 -0.827932\n",
       "9  0.108863  0.507810"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.tail()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1    False\n",
       "2    False\n",
       "3    False\n",
       "4     True\n",
       "5    False\n",
       "6    False\n",
       "7    False\n",
       "8    False\n",
       "9    False\n",
       "Name: x, dtype: bool"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['x'] > 0.5  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1    False\n",
       "2    False\n",
       "3     True\n",
       "4     True\n",
       "5    False\n",
       "6    False\n",
       "7    False\n",
       "8    False\n",
       "9    False\n",
       "dtype: bool"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(df['x'] > 0) & (df['y'] < 0)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0     True\n",
       "1     True\n",
       "2     True\n",
       "3     True\n",
       "4     True\n",
       "5    False\n",
       "6    False\n",
       "7     True\n",
       "8     True\n",
       "9     True\n",
       "dtype: bool"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(df['x'] > 0) | (df['y'] < 0)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.189622</td>\n",
       "      <td>-1.690617</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.007315</td>\n",
       "      <td>-0.612939</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.299748</td>\n",
       "      <td>-1.733096</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.108863</td>\n",
       "      <td>0.507810</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          x         y\n",
       "0  1.189622 -1.690617\n",
       "3  0.007315 -0.612939\n",
       "4  1.299748 -1.733096\n",
       "9  0.108863  0.507810"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df['x'] > 0]  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.189622</td>\n",
       "      <td>-1.690617</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.007315</td>\n",
       "      <td>-0.612939</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.299748</td>\n",
       "      <td>-1.733096</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.108863</td>\n",
       "      <td>0.507810</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          x         y\n",
       "0  1.189622 -1.690617\n",
       "3  0.007315 -0.612939\n",
       "4  1.299748 -1.733096\n",
       "9  0.108863  0.507810"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.query('x > 0')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.189622</td>\n",
       "      <td>-1.690617</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.007315</td>\n",
       "      <td>-0.612939</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.299748</td>\n",
       "      <td>-1.733096</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          x         y\n",
       "0  1.189622 -1.690617\n",
       "3  0.007315 -0.612939\n",
       "4  1.299748 -1.733096"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[(df['x'] > 0) & (df['y'] < 0)]  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.189622</td>\n",
       "      <td>-1.690617</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.007315</td>\n",
       "      <td>-0.612939</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.299748</td>\n",
       "      <td>-1.733096</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          x         y\n",
       "0  1.189622 -1.690617\n",
       "3  0.007315 -0.612939\n",
       "4  1.299748 -1.733096"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.query('x > 0 & y < 0')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.189622</td>\n",
       "      <td>-1.690617</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-1.356399</td>\n",
       "      <td>-1.232435</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.544439</td>\n",
       "      <td>-0.668172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.007315</td>\n",
       "      <td>-0.612939</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.299748</td>\n",
       "      <td>-1.733096</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-1.188018</td>\n",
       "      <td>-0.549746</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>-0.940046</td>\n",
       "      <td>-0.827932</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.108863</td>\n",
       "      <td>0.507810</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          x         y\n",
       "0  1.189622 -1.690617\n",
       "1 -1.356399 -1.232435\n",
       "2 -0.544439 -0.668172\n",
       "3  0.007315 -0.612939\n",
       "4  1.299748 -1.733096\n",
       "7 -1.188018 -0.549746\n",
       "8 -0.940046 -0.827932\n",
       "9  0.108863  0.507810"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[(df.x > 0) | (df.y < 0)]  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>True</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       x      y\n",
       "0   True  False\n",
       "1  False  False\n",
       "2  False  False\n",
       "3   True  False\n",
       "4   True  False\n",
       "5  False   True\n",
       "6  False   True\n",
       "7  False  False\n",
       "8  False  False\n",
       "9   True   True"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df > 0  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>x</th>\n",
       "      <th>y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.189622</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.007315</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1.299748</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>NaN</td>\n",
       "      <td>0.357508</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1.470714</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.108863</td>\n",
       "      <td>0.507810</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          x         y\n",
       "0  1.189622       NaN\n",
       "1       NaN       NaN\n",
       "2       NaN       NaN\n",
       "3  0.007315       NaN\n",
       "4  1.299748       NaN\n",
       "5       NaN  0.357508\n",
       "6       NaN  1.470714\n",
       "7       NaN       NaN\n",
       "8       NaN       NaN\n",
       "9  0.108863  0.507810"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df > 0]  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Concatenation, Joining and Merging"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [],
   "source": [
    "df1 = pd.DataFrame(['100', '200', '300', '400'], \n",
    "                    index=['a', 'b', 'c', 'd'],\n",
    "                    columns=['A',])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A\n",
       "a  100\n",
       "b  200\n",
       "c  300\n",
       "d  400"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [],
   "source": [
    "df2 = pd.DataFrame(['200', '150', '50'], \n",
    "                    index=['f', 'b', 'd'],\n",
    "                    columns=['B',])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {
    "slideshow": {
     "slide_type": "-"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>f</th>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     B\n",
       "f  200\n",
       "b  150\n",
       "d   50"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Concatenation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>300</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>f</th>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>NaN</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>NaN</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B\n",
       "a  100  NaN\n",
       "b  200  NaN\n",
       "c  300  NaN\n",
       "d  400  NaN\n",
       "f  NaN  200\n",
       "b  NaN  150\n",
       "d  NaN   50"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.append(df2, sort=False)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>200</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>300</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>400</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>NaN</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>NaN</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B\n",
       "0  100  NaN\n",
       "1  200  NaN\n",
       "2  300  NaN\n",
       "3  400  NaN\n",
       "4  NaN  200\n",
       "5  NaN  150\n",
       "6  NaN   50"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.append(df2, ignore_index=True, sort=False)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>300</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>f</th>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>NaN</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>NaN</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B\n",
       "a  100  NaN\n",
       "b  200  NaN\n",
       "c  300  NaN\n",
       "d  400  NaN\n",
       "f  NaN  200\n",
       "b  NaN  150\n",
       "d  NaN   50"
      ]
     },
     "execution_count": 95,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.concat((df1, df2), sort=False)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>200</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>300</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>400</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>NaN</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>NaN</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B\n",
       "0  100  NaN\n",
       "1  200  NaN\n",
       "2  300  NaN\n",
       "3  400  NaN\n",
       "4  NaN  200\n",
       "5  NaN  150\n",
       "6  NaN   50"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.concat((df1, df2), ignore_index=True, sort=False)  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Joining"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>300</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B\n",
       "a  100  NaN\n",
       "b  200  150\n",
       "c  300  NaN\n",
       "d  400   50"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.join(df2)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>B</th>\n",
       "      <th>A</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>f</th>\n",
       "      <td>200</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>150</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>50</td>\n",
       "      <td>400</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     B    A\n",
       "f  200  NaN\n",
       "b  150  200\n",
       "d   50  400"
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2.join(df1)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>300</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B\n",
       "a  100  NaN\n",
       "b  200  150\n",
       "c  300  NaN\n",
       "d  400   50"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.join(df2, how='left')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>f</th>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B\n",
       "f  NaN  200\n",
       "b  200  150\n",
       "d  400   50"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.join(df2, how='right')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B\n",
       "b  200  150\n",
       "d  400   50"
      ]
     },
     "execution_count": 101,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.join(df2, how='inner')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>300</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>f</th>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B\n",
       "a  100  NaN\n",
       "b  200  150\n",
       "c  300  NaN\n",
       "d  400   50\n",
       "f  NaN  200"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.join(df2, how='outer')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['A'] = df1['A']  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A\n",
       "a  100\n",
       "b  200\n",
       "c  300\n",
       "d  400"
      ]
     },
     "execution_count": 105,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [],
   "source": [
    "df['B'] = df2  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 107,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>300</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B\n",
       "a  100  NaN\n",
       "b  200  150\n",
       "c  300  NaN\n",
       "d  400   50"
      ]
     },
     "execution_count": 107,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame({'A': df1['A'], 'B': df2['B']})  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 109,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>300</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>f</th>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    B\n",
       "a  100  NaN\n",
       "b  200  150\n",
       "c  300  NaN\n",
       "d  400   50\n",
       "f  NaN  200"
      ]
     },
     "execution_count": 109,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Merging"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {},
   "outputs": [],
   "source": [
    "c = pd.Series([250, 150, 50], index=['b', 'd', 'c'])\n",
    "df1['C'] = c\n",
    "df2['C'] = c"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>C</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>a</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "      <td>250.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>c</th>\n",
       "      <td>300</td>\n",
       "      <td>50.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "      <td>150.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A      C\n",
       "a  100    NaN\n",
       "b  200  250.0\n",
       "c  300   50.0\n",
       "d  400  150.0"
      ]
     },
     "execution_count": 111,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>f</th>\n",
       "      <td>200</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>150</td>\n",
       "      <td>250.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>50</td>\n",
       "      <td>150.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     B      C\n",
       "f  200    NaN\n",
       "b  150  250.0\n",
       "d   50  150.0"
      ]
     },
     "execution_count": 112,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 113,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>C</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>200</td>\n",
       "      <td>250.0</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>400</td>\n",
       "      <td>150.0</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A      C    B\n",
       "0  100    NaN  200\n",
       "1  200  250.0  150\n",
       "2  400  150.0   50"
      ]
     },
     "execution_count": 113,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.merge(df1, df2)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 114,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>C</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>200</td>\n",
       "      <td>250.0</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>400</td>\n",
       "      <td>150.0</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A      C    B\n",
       "0  100    NaN  200\n",
       "1  200  250.0  150\n",
       "2  400  150.0   50"
      ]
     },
     "execution_count": 114,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.merge(df1, df2, on='C')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 115,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>C</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>200</td>\n",
       "      <td>250.0</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>300</td>\n",
       "      <td>50.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>400</td>\n",
       "      <td>150.0</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A      C    B\n",
       "0  100    NaN  200\n",
       "1  200  250.0  150\n",
       "2  300   50.0  NaN\n",
       "3  400  150.0   50"
      ]
     },
     "execution_count": 115,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.merge(df1, df2, how='outer')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 116,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>C_x</th>\n",
       "      <th>B</th>\n",
       "      <th>C_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>200</td>\n",
       "      <td>250.0</td>\n",
       "      <td>200</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    C_x    B  C_y\n",
       "0  200  250.0  200  NaN"
      ]
     },
     "execution_count": 116,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.merge(df1, df2, left_on='A', right_on='B')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>C_x</th>\n",
       "      <th>B</th>\n",
       "      <th>C_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>200</td>\n",
       "      <td>250.0</td>\n",
       "      <td>200</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>300</td>\n",
       "      <td>50.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>400</td>\n",
       "      <td>150.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>150</td>\n",
       "      <td>250.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>50</td>\n",
       "      <td>150.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    C_x    B    C_y\n",
       "0  100    NaN  NaN    NaN\n",
       "1  200  250.0  200    NaN\n",
       "2  300   50.0  NaN    NaN\n",
       "3  400  150.0  NaN    NaN\n",
       "4  NaN    NaN  150  250.0\n",
       "5  NaN    NaN   50  150.0"
      ]
     },
     "execution_count": 117,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.merge(df1, df2, left_on='A', right_on='B', how='outer')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 118,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>C_x</th>\n",
       "      <th>B</th>\n",
       "      <th>C_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>b</th>\n",
       "      <td>200</td>\n",
       "      <td>250.0</td>\n",
       "      <td>150</td>\n",
       "      <td>250.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>d</th>\n",
       "      <td>400</td>\n",
       "      <td>150.0</td>\n",
       "      <td>50</td>\n",
       "      <td>150.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    C_x    B    C_y\n",
       "b  200  250.0  150  250.0\n",
       "d  400  150.0   50  150.0"
      ]
     },
     "execution_count": 118,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.merge(df1, df2, left_index=True, right_index=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 119,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>C</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>200</td>\n",
       "      <td>250.0</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>400</td>\n",
       "      <td>150.0</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A      C    B\n",
       "0  100    NaN  200\n",
       "1  200  250.0  150\n",
       "2  400  150.0   50"
      ]
     },
     "execution_count": 119,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.merge(df1, df2, on='C')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 120,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>C</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>100</td>\n",
       "      <td>NaN</td>\n",
       "      <td>200</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>200</td>\n",
       "      <td>250.0</td>\n",
       "      <td>150</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>300</td>\n",
       "      <td>50.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>400</td>\n",
       "      <td>150.0</td>\n",
       "      <td>50</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A      C    B\n",
       "0  100    NaN  200\n",
       "1  200  250.0  150\n",
       "2  300   50.0  NaN\n",
       "3  400  150.0   50"
      ]
     },
     "execution_count": 120,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.merge(df1, df2, on='C', how='outer')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 121,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>C_x</th>\n",
       "      <th>B</th>\n",
       "      <th>C_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>200</td>\n",
       "      <td>250.0</td>\n",
       "      <td>200</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A    C_x    B  C_y\n",
       "0  200  250.0  200  NaN"
      ]
     },
     "execution_count": 121,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.merge(df1, df2, left_on='A', right_on='B')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Performance Aspects"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 122,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = np.random.standard_normal((1000000, 2))  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 123,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16000000"
      ]
     },
     "execution_count": 123,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.nbytes  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 124,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame(data, columns=['x', 'y'])  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 125,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 1000000 entries, 0 to 999999\n",
      "Data columns (total 2 columns):\n",
      " #   Column  Non-Null Count    Dtype  \n",
      "---  ------  --------------    -----  \n",
      " 0   x       1000000 non-null  float64\n",
      " 1   y       1000000 non-null  float64\n",
      "dtypes: float64(2)\n",
      "memory usage: 15.3 MB\n"
     ]
    }
   ],
   "source": [
    "df.info()  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 126,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 2.1 ms, sys: 3.06 ms, total: 5.16 ms\n",
      "Wall time: 1.55 ms\n"
     ]
    }
   ],
   "source": [
    "%time res = df['x'] + df['y']  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 127,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    0.387242\n",
       "1   -0.969343\n",
       "2   -0.863159\n",
       "dtype: float64"
      ]
     },
     "execution_count": 127,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res[:3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 128,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 15.4 ms, sys: 3.99 ms, total: 19.4 ms\n",
      "Wall time: 18.1 ms\n"
     ]
    }
   ],
   "source": [
    "%time res = df.sum(axis=1)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 129,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    0.387242\n",
       "1   -0.969343\n",
       "2   -0.863159\n",
       "dtype: float64"
      ]
     },
     "execution_count": 129,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res[:3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 130,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 7.33 ms, sys: 1.59 ms, total: 8.92 ms\n",
      "Wall time: 8.42 ms\n"
     ]
    }
   ],
   "source": [
    "%time res = df.values.sum(axis=1)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 131,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.3872424 , -0.96934273, -0.86315944])"
      ]
     },
     "execution_count": 131,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res[:3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 132,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 15 ms, sys: 3.59 ms, total: 18.6 ms\n",
      "Wall time: 18.6 ms\n"
     ]
    }
   ],
   "source": [
    "%time res = np.sum(df, axis=1)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 133,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    0.387242\n",
       "1   -0.969343\n",
       "2   -0.863159\n",
       "dtype: float64"
      ]
     },
     "execution_count": 133,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res[:3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 134,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 6.69 ms, sys: 1.89 ms, total: 8.57 ms\n",
      "Wall time: 7.09 ms\n"
     ]
    }
   ],
   "source": [
    "%time res = np.sum(df.values, axis=1)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.3872424 , -0.96934273, -0.86315944])"
      ]
     },
     "execution_count": 135,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res[:3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 136,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 3.98 ms, sys: 4.97 ms, total: 8.95 ms\n",
      "Wall time: 5.8 ms\n"
     ]
    }
   ],
   "source": [
    "%time res = df.eval('x + y')  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 137,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    0.387242\n",
       "1   -0.969343\n",
       "2   -0.863159\n",
       "dtype: float64"
      ]
     },
     "execution_count": 137,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res[:3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 138,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 4.26 s, sys: 40.6 ms, total: 4.3 s\n",
      "Wall time: 4.31 s\n"
     ]
    }
   ],
   "source": [
    "%time res = df.apply(lambda row: row['x'] + row['y'], axis=1)  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    0.387242\n",
       "1   -0.969343\n",
       "2   -0.863159\n",
       "dtype: float64"
      ]
     },
     "execution_count": 139,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "res[:3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"http://hilpisch.com/tpq_logo.png\" alt=\"The Python Quants\" width=\"35%\" align=\"right\" border=\"0\"><br>\n",
    "\n",
    "<a href=\"http://tpq.io\" target=\"_blank\">http://tpq.io</a> | <a href=\"http://twitter.com/dyjh\" target=\"_blank\">@dyjh</a> | <a href=\"mailto:training@tpq.io\">training@tpq.io</a>"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
